Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.1 KiB

  1. URI Template Tests
  2. ==================
  3. This is a set of tests for implementations of
  4. [RFC6570](http://tools.ietf.org/html/rfc6570) - URI Template. It is designed
  5. to be reused by any implementation, to improve interoperability and
  6. implementation quality.
  7. If your project uses Git for version control, you can make uritemplate-tests into a [submodule](http://help.github.com/submodules/).
  8. Test Format
  9. -----------
  10. Each test file is a [JSON](http://tools.ietf.org/html/RFC6627) document
  11. containing an object whose properties are groups of related tests.
  12. Alternatively, all tests are available in XML as well, with the XML files
  13. being generated by transform-json-tests.xslt which uses json2xml.xslt as a
  14. general-purpose JSON-to-XML parsing library.
  15. Each group, in turn, is an object with three children:
  16. * level - the level of the tests covered, as per the RFC (optional; if absent,
  17. assume level 4).
  18. * variables - an object representing the variables that are available to the
  19. tests in the suite
  20. * testcases - a list of testcases, where each case is a two-member list, the
  21. first being the template, the second being the result of expanding the
  22. template with the provided variables.
  23. Note that the result string can be a few different things:
  24. * string - if the second member is a string, the result of expansion is
  25. expected to match it, character-for-character.
  26. * list - if the second member is a list of strings, the result of expansion
  27. is expected to match one of them; this allows for templates that can
  28. expand into different, equally-acceptable URIs.
  29. * false - if the second member is boolean false, expansion is expected to
  30. fail (i.e., the template was invalid).
  31. For example:
  32. {
  33. "Level 1 Examples" :
  34. {
  35. "level": 1,
  36. "variables": {
  37. "var" : "value",
  38. "hello" : "Hello World!"
  39. },
  40. "testcases" : [
  41. ["{var}", "value"],
  42. ["{hello}", "Hello%20World%21"]
  43. ]
  44. }
  45. }
  46. Tests Included
  47. --------------
  48. The following test files are included:
  49. * spec-examples.json - The complete set of example templates from the RFC
  50. * spec-examples-by-section.json - The examples, section by section
  51. * extended-tests.json - more complex test cases
  52. * negative-tests.json - invalid templates
  53. For all these test files, XML versions with the names *.xml can be
  54. generated with the transform-json-tests.xslt XSLT stylesheet. The XSLT
  55. contains the names of the above test files as a parameter, and can be
  56. started with any XML as input (i.e., the XML input is ignored).
  57. License
  58. -------
  59. Copyright 2011-2012 The Authors
  60. Licensed under the Apache License, Version 2.0 (the "License");
  61. you may not use this file except in compliance with the License.
  62. You may obtain a copy of the License at
  63. http://www.apache.org/licenses/LICENSE-2.0
  64. Unless required by applicable law or agreed to in writing, software
  65. distributed under the License is distributed on an "AS IS" BASIS,
  66. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  67. See the License for the specific language governing permissions and
  68. limitations under the License.