ctags.rb 1.0.0 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +2 -1
  3. data/README.md +49 -0
  4. data/Rakefile +19 -0
  5. data/bench.rb +28 -0
  6. data/ctags.rb.gemspec +1 -1
  7. data/ext/.gitignore +1 -1
  8. data/ext/extconf.rb +30 -6
  9. data/ext/vendor/exuberant-ctags/entry.c +70 -1
  10. data/ext/vendor/exuberant-ctags/main.c +68 -7
  11. data/ext/vendor/exuberant-ctags/options.c +12 -12
  12. data/ext/vendor/exuberant-ctags/options.h +1 -1
  13. data/ext/vendor/exuberant-ctags/parse.c +2 -2
  14. data/ext/vendor/exuberant-ctags/read.c +8 -3
  15. data/ext/vendor/exuberant-ctags/read.h +4 -1
  16. data/ext/vendor/exuberant-ctags/routines.c +31 -8
  17. data/ext/vendor/exuberant-ctags/ruby.c +62 -7
  18. data/ext/vendor/fmemopen/README.md +49 -0
  19. data/ext/vendor/fmemopen/fmemopen.c +92 -0
  20. data/ext/vendor/fmemopen/fmemopen.h +52 -0
  21. data/ext/vendor/jansson-2.5/CHANGES +554 -0
  22. data/ext/vendor/jansson-2.5/LICENSE +19 -0
  23. data/ext/vendor/jansson-2.5/Makefile.am +15 -0
  24. data/ext/vendor/jansson-2.5/Makefile.in +825 -0
  25. data/ext/vendor/jansson-2.5/README.rst +63 -0
  26. data/ext/vendor/jansson-2.5/aclocal.m4 +9674 -0
  27. data/ext/vendor/jansson-2.5/config.guess +1530 -0
  28. data/ext/vendor/jansson-2.5/config.h.in +84 -0
  29. data/ext/vendor/jansson-2.5/config.sub +1782 -0
  30. data/ext/vendor/jansson-2.5/configure +13931 -0
  31. data/ext/vendor/jansson-2.5/configure.ac +57 -0
  32. data/ext/vendor/jansson-2.5/depcomp +708 -0
  33. data/ext/vendor/jansson-2.5/doc/Makefile.am +20 -0
  34. data/ext/vendor/jansson-2.5/doc/Makefile.in +401 -0
  35. data/ext/vendor/jansson-2.5/doc/README +5 -0
  36. data/ext/vendor/jansson-2.5/doc/apiref.rst +1487 -0
  37. data/ext/vendor/jansson-2.5/doc/changes.rst +5 -0
  38. data/ext/vendor/jansson-2.5/doc/conf.py +217 -0
  39. data/ext/vendor/jansson-2.5/doc/conformance.rst +114 -0
  40. data/ext/vendor/jansson-2.5/doc/ext/refcounting.py +59 -0
  41. data/ext/vendor/jansson-2.5/doc/gettingstarted.rst +237 -0
  42. data/ext/vendor/jansson-2.5/doc/github_commits.c +192 -0
  43. data/ext/vendor/jansson-2.5/doc/index.rst +53 -0
  44. data/ext/vendor/jansson-2.5/doc/portability.rst +52 -0
  45. data/ext/vendor/jansson-2.5/doc/tutorial.rst +286 -0
  46. data/ext/vendor/jansson-2.5/doc/upgrading.rst +76 -0
  47. data/ext/vendor/jansson-2.5/install-sh +527 -0
  48. data/ext/vendor/jansson-2.5/jansson.pc.in +10 -0
  49. data/ext/vendor/jansson-2.5/ltmain.sh +9661 -0
  50. data/ext/vendor/jansson-2.5/missing +331 -0
  51. data/ext/vendor/jansson-2.5/src/Makefile.am +24 -0
  52. data/ext/vendor/jansson-2.5/src/Makefile.in +613 -0
  53. data/ext/vendor/jansson-2.5/src/dump.c +456 -0
  54. data/ext/vendor/jansson-2.5/src/error.c +63 -0
  55. data/ext/vendor/jansson-2.5/src/hashtable.c +360 -0
  56. data/ext/vendor/jansson-2.5/src/hashtable.h +180 -0
  57. data/ext/vendor/jansson-2.5/src/jansson.def +63 -0
  58. data/ext/vendor/jansson-2.5/src/jansson.h +281 -0
  59. data/ext/vendor/jansson-2.5/src/jansson_config.h +39 -0
  60. data/ext/vendor/jansson-2.5/src/jansson_config.h.in +39 -0
  61. data/ext/vendor/jansson-2.5/src/jansson_private.h +93 -0
  62. data/ext/vendor/jansson-2.5/src/load.c +1077 -0
  63. data/ext/vendor/jansson-2.5/src/memory.c +56 -0
  64. data/ext/vendor/jansson-2.5/src/pack_unpack.c +762 -0
  65. data/ext/vendor/jansson-2.5/src/strbuffer.c +116 -0
  66. data/ext/vendor/jansson-2.5/src/strbuffer.h +33 -0
  67. data/ext/vendor/jansson-2.5/src/strconv.c +134 -0
  68. data/ext/vendor/jansson-2.5/src/utf.c +190 -0
  69. data/ext/vendor/jansson-2.5/src/utf.h +39 -0
  70. data/ext/vendor/jansson-2.5/src/value.c +950 -0
  71. data/ext/vendor/jansson-2.5/test/Makefile.am +10 -0
  72. data/ext/vendor/jansson-2.5/test/Makefile.in +684 -0
  73. data/ext/vendor/jansson-2.5/test/bin/Makefile.am +5 -0
  74. data/ext/vendor/jansson-2.5/test/bin/Makefile.in +498 -0
  75. data/ext/vendor/jansson-2.5/test/bin/json_process.c +349 -0
  76. data/ext/vendor/jansson-2.5/test/run-suites +50 -0
  77. data/ext/vendor/jansson-2.5/test/scripts/run-tests.sh +100 -0
  78. data/ext/vendor/jansson-2.5/test/scripts/valgrind.sh +35 -0
  79. data/ext/vendor/jansson-2.5/test/suites/Makefile.am +2 -0
  80. data/ext/vendor/jansson-2.5/test/suites/Makefile.in +580 -0
  81. data/ext/vendor/jansson-2.5/test/suites/api/Makefile.am +34 -0
  82. data/ext/vendor/jansson-2.5/test/suites/api/Makefile.in +632 -0
  83. data/ext/vendor/jansson-2.5/test/suites/api/check-exports +23 -0
  84. data/ext/vendor/jansson-2.5/test/suites/api/run +36 -0
  85. data/ext/vendor/jansson-2.5/test/suites/api/test_array.c +432 -0
  86. data/ext/vendor/jansson-2.5/test/suites/api/test_copy.c +318 -0
  87. data/ext/vendor/jansson-2.5/test/suites/api/test_dump.c +190 -0
  88. data/ext/vendor/jansson-2.5/test/suites/api/test_dump_callback.c +81 -0
  89. data/ext/vendor/jansson-2.5/test/suites/api/test_equal.c +189 -0
  90. data/ext/vendor/jansson-2.5/test/suites/api/test_load.c +166 -0
  91. data/ext/vendor/jansson-2.5/test/suites/api/test_load_callback.c +75 -0
  92. data/ext/vendor/jansson-2.5/test/suites/api/test_loadb.c +36 -0
  93. data/ext/vendor/jansson-2.5/test/suites/api/test_memory_funcs.c +82 -0
  94. data/ext/vendor/jansson-2.5/test/suites/api/test_number.c +73 -0
  95. data/ext/vendor/jansson-2.5/test/suites/api/test_object.c +511 -0
  96. data/ext/vendor/jansson-2.5/test/suites/api/test_pack.c +283 -0
  97. data/ext/vendor/jansson-2.5/test/suites/api/test_simple.c +199 -0
  98. data/ext/vendor/jansson-2.5/test/suites/api/test_unpack.c +373 -0
  99. data/ext/vendor/jansson-2.5/test/suites/api/util.h +74 -0
  100. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/encoded-surrogate-half/error +2 -0
  101. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/encoded-surrogate-half/input +1 -0
  102. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error +2 -0
  103. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input +1 -0
  104. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-array/error +2 -0
  105. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-array/input +1 -0
  106. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error +2 -0
  107. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input +1 -0
  108. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-escape/error +2 -0
  109. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-escape/input +1 -0
  110. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error +2 -0
  111. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input +1 -0
  112. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error +2 -0
  113. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input +1 -0
  114. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-int/error +2 -0
  115. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-int/input +1 -0
  116. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error +2 -0
  117. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input +1 -0
  118. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-string/error +2 -0
  119. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-string/input +1 -0
  120. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-invalid-utf-8/error +2 -0
  121. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-invalid-utf-8/input +1 -0
  122. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error +2 -0
  123. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input +1 -0
  124. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/not-in-unicode-range/error +2 -0
  125. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/not-in-unicode-range/input +1 -0
  126. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-3-byte-encoding/error +2 -0
  127. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-3-byte-encoding/input +1 -0
  128. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-4-byte-encoding/error +2 -0
  129. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-4-byte-encoding/input +1 -0
  130. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-ascii-encoding/error +2 -0
  131. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-ascii-encoding/input +1 -0
  132. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/restricted-utf-8/error +2 -0
  133. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/restricted-utf-8/input +1 -0
  134. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/run +27 -0
  135. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/truncated-utf-8/error +2 -0
  136. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/truncated-utf-8/input +1 -0
  137. data/ext/vendor/jansson-2.5/test/suites/invalid/apostrophe/error +2 -0
  138. data/ext/vendor/jansson-2.5/test/suites/invalid/apostrophe/input +1 -0
  139. data/ext/vendor/jansson-2.5/test/suites/invalid/ascii-unicode-identifier/error +2 -0
  140. data/ext/vendor/jansson-2.5/test/suites/invalid/ascii-unicode-identifier/input +1 -0
  141. data/ext/vendor/jansson-2.5/test/suites/invalid/brace-comma/error +2 -0
  142. data/ext/vendor/jansson-2.5/test/suites/invalid/brace-comma/input +1 -0
  143. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-comma/error +2 -0
  144. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-comma/input +1 -0
  145. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/error.normal +2 -0
  146. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/error.strip +2 -0
  147. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/input +1 -0
  148. data/ext/vendor/jansson-2.5/test/suites/invalid/empty/error +2 -0
  149. data/ext/vendor/jansson-2.5/test/suites/invalid/empty/input +0 -0
  150. data/ext/vendor/jansson-2.5/test/suites/invalid/escaped-null-byte-in-string/error +2 -0
  151. data/ext/vendor/jansson-2.5/test/suites/invalid/escaped-null-byte-in-string/input +1 -0
  152. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-array/error +2 -0
  153. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-array/input +1 -0
  154. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-multiline-array/error +2 -0
  155. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-multiline-array/input +6 -0
  156. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-after-newline/error +2 -0
  157. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-after-newline/input +2 -0
  158. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-at-the-end/error +2 -0
  159. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-at-the-end/input +1 -0
  160. data/ext/vendor/jansson-2.5/test/suites/invalid/integer-starting-with-zero/error +2 -0
  161. data/ext/vendor/jansson-2.5/test/suites/invalid/integer-starting-with-zero/input +1 -0
  162. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-escape/error +2 -0
  163. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-escape/input +1 -0
  164. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-identifier/error +2 -0
  165. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-identifier/input +1 -0
  166. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-integer/error +2 -0
  167. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-integer/input +1 -0
  168. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-real/error +2 -0
  169. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-real/input +1 -0
  170. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-second-surrogate/error +2 -0
  171. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-second-surrogate/input +1 -0
  172. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/error.normal +2 -0
  173. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/error.strip +2 -0
  174. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/input +1 -0
  175. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/error.normal +2 -0
  176. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/error.strip +2 -0
  177. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/input +1 -0
  178. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-second-surrogate/error +2 -0
  179. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-second-surrogate/input +1 -0
  180. data/ext/vendor/jansson-2.5/test/suites/invalid/minus-sign-without-number/error +2 -0
  181. data/ext/vendor/jansson-2.5/test/suites/invalid/minus-sign-without-number/input +1 -0
  182. data/ext/vendor/jansson-2.5/test/suites/invalid/negative-integer-starting-with-zero/error +2 -0
  183. data/ext/vendor/jansson-2.5/test/suites/invalid/negative-integer-starting-with-zero/input +1 -0
  184. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/error +2 -0
  185. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/input +0 -0
  186. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/nostrip +2 -0
  187. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/error +2 -0
  188. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/input +0 -0
  189. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/nostrip +2 -0
  190. data/ext/vendor/jansson-2.5/test/suites/invalid/null/error +2 -0
  191. data/ext/vendor/jansson-2.5/test/suites/invalid/null/input +1 -0
  192. data/ext/vendor/jansson-2.5/test/suites/invalid/object-apostrophes/error +2 -0
  193. data/ext/vendor/jansson-2.5/test/suites/invalid/object-apostrophes/input +1 -0
  194. data/ext/vendor/jansson-2.5/test/suites/invalid/object-garbage-at-end/error +2 -0
  195. data/ext/vendor/jansson-2.5/test/suites/invalid/object-garbage-at-end/input +1 -0
  196. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/error.normal +2 -0
  197. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/error.strip +2 -0
  198. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/input +1 -0
  199. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/error.normal +2 -0
  200. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/error.strip +2 -0
  201. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/input +1 -0
  202. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/error.normal +2 -0
  203. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/error.strip +2 -0
  204. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/input +1 -0
  205. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/error.normal +2 -0
  206. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/error.strip +2 -0
  207. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/input +1 -0
  208. data/ext/vendor/jansson-2.5/test/suites/invalid/real-garbage-after-e/error +2 -0
  209. data/ext/vendor/jansson-2.5/test/suites/invalid/real-garbage-after-e/input +1 -0
  210. data/ext/vendor/jansson-2.5/test/suites/invalid/real-negative-overflow/error +2 -0
  211. data/ext/vendor/jansson-2.5/test/suites/invalid/real-negative-overflow/input +1 -0
  212. data/ext/vendor/jansson-2.5/test/suites/invalid/real-positive-overflow/error +2 -0
  213. data/ext/vendor/jansson-2.5/test/suites/invalid/real-positive-overflow/input +1 -0
  214. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-e/error +2 -0
  215. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-e/input +1 -0
  216. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-point/error +2 -0
  217. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-point/input +1 -0
  218. data/ext/vendor/jansson-2.5/test/suites/invalid/run +57 -0
  219. data/ext/vendor/jansson-2.5/test/suites/invalid/tab-character-in-string/error +2 -0
  220. data/ext/vendor/jansson-2.5/test/suites/invalid/tab-character-in-string/input +1 -0
  221. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-negative-integer/error +2 -0
  222. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-negative-integer/input +1 -0
  223. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-positive-integer/error +2 -0
  224. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-positive-integer/input +1 -0
  225. data/ext/vendor/jansson-2.5/test/suites/invalid/truncated-unicode-surrogate/error +2 -0
  226. data/ext/vendor/jansson-2.5/test/suites/invalid/truncated-unicode-surrogate/input +1 -0
  227. data/ext/vendor/jansson-2.5/test/suites/invalid/unicode-identifier/error +2 -0
  228. data/ext/vendor/jansson-2.5/test/suites/invalid/unicode-identifier/input +1 -0
  229. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/error.normal +2 -0
  230. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/error.strip +2 -0
  231. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/input +1 -0
  232. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/error.normal +2 -0
  233. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/error.strip +2 -0
  234. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/input +1 -0
  235. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/error.normal +2 -0
  236. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/error.strip +2 -0
  237. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/input +1 -0
  238. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/error.normal +2 -0
  239. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/error.strip +2 -0
  240. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/input +1 -0
  241. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-object-and-array/error +2 -0
  242. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-object-and-array/input +1 -0
  243. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/error.normal +2 -0
  244. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/error.strip +2 -0
  245. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/input +1 -0
  246. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/env +1 -0
  247. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/input +5 -0
  248. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/output +1 -0
  249. data/ext/vendor/jansson-2.5/test/suites/valid/empty-array/input +1 -0
  250. data/ext/vendor/jansson-2.5/test/suites/valid/empty-array/output +1 -0
  251. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object-in-array/input +1 -0
  252. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object-in-array/output +1 -0
  253. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object/input +1 -0
  254. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object/output +1 -0
  255. data/ext/vendor/jansson-2.5/test/suites/valid/empty-string/input +1 -0
  256. data/ext/vendor/jansson-2.5/test/suites/valid/empty-string/output +1 -0
  257. data/ext/vendor/jansson-2.5/test/suites/valid/escaped-utf-control-char/input +1 -0
  258. data/ext/vendor/jansson-2.5/test/suites/valid/escaped-utf-control-char/output +1 -0
  259. data/ext/vendor/jansson-2.5/test/suites/valid/false/input +1 -0
  260. data/ext/vendor/jansson-2.5/test/suites/valid/false/output +1 -0
  261. data/ext/vendor/jansson-2.5/test/suites/valid/negative-int/input +1 -0
  262. data/ext/vendor/jansson-2.5/test/suites/valid/negative-int/output +1 -0
  263. data/ext/vendor/jansson-2.5/test/suites/valid/negative-one/input +1 -0
  264. data/ext/vendor/jansson-2.5/test/suites/valid/negative-one/output +1 -0
  265. data/ext/vendor/jansson-2.5/test/suites/valid/negative-zero/input +1 -0
  266. data/ext/vendor/jansson-2.5/test/suites/valid/negative-zero/output +1 -0
  267. data/ext/vendor/jansson-2.5/test/suites/valid/null/input +1 -0
  268. data/ext/vendor/jansson-2.5/test/suites/valid/null/output +1 -0
  269. data/ext/vendor/jansson-2.5/test/suites/valid/one-byte-utf-8/input +1 -0
  270. data/ext/vendor/jansson-2.5/test/suites/valid/one-byte-utf-8/output +1 -0
  271. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-negative-exponent/input +1 -0
  272. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-negative-exponent/output +1 -0
  273. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-positive-exponent/input +1 -0
  274. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-positive-exponent/output +1 -0
  275. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e/input +1 -0
  276. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e/output +1 -0
  277. data/ext/vendor/jansson-2.5/test/suites/valid/real-exponent/input +1 -0
  278. data/ext/vendor/jansson-2.5/test/suites/valid/real-exponent/output +1 -0
  279. data/ext/vendor/jansson-2.5/test/suites/valid/real-fraction-exponent/input +1 -0
  280. data/ext/vendor/jansson-2.5/test/suites/valid/real-fraction-exponent/output +1 -0
  281. data/ext/vendor/jansson-2.5/test/suites/valid/real-negative-exponent/input +1 -0
  282. data/ext/vendor/jansson-2.5/test/suites/valid/real-negative-exponent/output +1 -0
  283. data/ext/vendor/jansson-2.5/test/suites/valid/real-positive-exponent/input +1 -0
  284. data/ext/vendor/jansson-2.5/test/suites/valid/real-positive-exponent/output +1 -0
  285. data/ext/vendor/jansson-2.5/test/suites/valid/real-underflow/input +1 -0
  286. data/ext/vendor/jansson-2.5/test/suites/valid/real-underflow/output +1 -0
  287. data/ext/vendor/jansson-2.5/test/suites/valid/run +56 -0
  288. data/ext/vendor/jansson-2.5/test/suites/valid/short-string/input +1 -0
  289. data/ext/vendor/jansson-2.5/test/suites/valid/short-string/output +1 -0
  290. data/ext/vendor/jansson-2.5/test/suites/valid/simple-ascii-string/input +1 -0
  291. data/ext/vendor/jansson-2.5/test/suites/valid/simple-ascii-string/output +1 -0
  292. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-0/input +1 -0
  293. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-0/output +1 -0
  294. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-1/input +1 -0
  295. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-1/output +1 -0
  296. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-123/input +1 -0
  297. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-123/output +1 -0
  298. data/ext/vendor/jansson-2.5/test/suites/valid/simple-object/input +1 -0
  299. data/ext/vendor/jansson-2.5/test/suites/valid/simple-object/output +1 -0
  300. data/ext/vendor/jansson-2.5/test/suites/valid/simple-real/input +1 -0
  301. data/ext/vendor/jansson-2.5/test/suites/valid/simple-real/output +1 -0
  302. data/ext/vendor/jansson-2.5/test/suites/valid/string-escapes/input +1 -0
  303. data/ext/vendor/jansson-2.5/test/suites/valid/string-escapes/output +1 -0
  304. data/ext/vendor/jansson-2.5/test/suites/valid/three-byte-utf-8/input +1 -0
  305. data/ext/vendor/jansson-2.5/test/suites/valid/three-byte-utf-8/output +1 -0
  306. data/ext/vendor/jansson-2.5/test/suites/valid/true/input +1 -0
  307. data/ext/vendor/jansson-2.5/test/suites/valid/true/output +1 -0
  308. data/ext/vendor/jansson-2.5/test/suites/valid/two-byte-utf-8/input +1 -0
  309. data/ext/vendor/jansson-2.5/test/suites/valid/two-byte-utf-8/output +1 -0
  310. data/ext/vendor/jansson-2.5/test/suites/valid/utf-8-string/input +1 -0
  311. data/ext/vendor/jansson-2.5/test/suites/valid/utf-8-string/output +1 -0
  312. data/ext/vendor/jansson-2.5/test/suites/valid/utf-surrogate-four-byte-encoding/input +1 -0
  313. data/ext/vendor/jansson-2.5/test/suites/valid/utf-surrogate-four-byte-encoding/output +1 -0
  314. data/ext/vendor/jansson-2.5/win32/jansson_config.h +39 -0
  315. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.sln +20 -0
  316. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj +108 -0
  317. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj.filters +69 -0
  318. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj.user +3 -0
  319. data/lib/ctags.cnf +2 -0
  320. data/lib/ctags/exuberant.rb +129 -17
  321. data/lib/ctags/version.rb +1 -1
  322. data/test/test_ctags.rb +14 -7
  323. metadata +350 -69
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
3
+ *
4
+ * Jansson is free software; you can redistribute it and/or modify
5
+ * it under the terms of the MIT license. See LICENSE for details.
6
+ */
7
+
8
+ #include <jansson.h>
9
+ #include <string.h>
10
+ #include <stdlib.h>
11
+ #include "util.h"
12
+
13
+ struct my_sink {
14
+ char *buf;
15
+ size_t off;
16
+ size_t cap;
17
+ };
18
+
19
+ static int my_writer(const char *buffer, size_t len, void *data) {
20
+ struct my_sink *s = data;
21
+ if (len > s->cap - s->off) {
22
+ return -1;
23
+ }
24
+ memcpy(s->buf + s->off, buffer, len);
25
+ s->off += len;
26
+ return 0;
27
+ }
28
+
29
+ static void run_tests()
30
+ {
31
+ struct my_sink s;
32
+ json_t *json;
33
+ const char str[] = "[\"A\", {\"B\": \"C\", \"e\": false}, 1, null, \"foo\"]";
34
+ char *dumped_to_string;
35
+
36
+ json = json_loads(str, 0, NULL);
37
+ if(!json) {
38
+ fail("json_loads failed");
39
+ }
40
+
41
+ dumped_to_string = json_dumps(json, 0);
42
+ if (!dumped_to_string) {
43
+ json_decref(json);
44
+ fail("json_dumps failed");
45
+ }
46
+
47
+ s.off = 0;
48
+ s.cap = strlen(dumped_to_string);
49
+ s.buf = malloc(s.cap);
50
+ if (!s.buf) {
51
+ json_decref(json);
52
+ free(dumped_to_string);
53
+ fail("malloc failed");
54
+ }
55
+
56
+ if (json_dump_callback(json, my_writer, &s, 0) == -1) {
57
+ json_decref(json);
58
+ free(dumped_to_string);
59
+ free(s.buf);
60
+ fail("json_dump_callback failed on an exact-length sink buffer");
61
+ }
62
+
63
+ if (strncmp(dumped_to_string, s.buf, s.off) != 0) {
64
+ json_decref(json);
65
+ free(dumped_to_string);
66
+ free(s.buf);
67
+ fail("json_dump_callback and json_dumps did not produce identical output");
68
+ }
69
+
70
+ s.off = 1;
71
+ if (json_dump_callback(json, my_writer, &s, 0) != -1) {
72
+ json_decref(json);
73
+ free(dumped_to_string);
74
+ free(s.buf);
75
+ fail("json_dump_callback succeeded on a short buffer when it should have failed");
76
+ }
77
+
78
+ json_decref(json);
79
+ free(dumped_to_string);
80
+ free(s.buf);
81
+ }
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
3
+ *
4
+ * Jansson is free software; you can redistribute it and/or modify
5
+ * it under the terms of the MIT license. See LICENSE for details.
6
+ */
7
+
8
+ #include <jansson.h>
9
+ #include "util.h"
10
+
11
+ static void test_equal_simple()
12
+ {
13
+ json_t *value1, *value2;
14
+
15
+ if(json_equal(NULL, NULL))
16
+ fail("json_equal fails for two NULLs");
17
+
18
+ value1 = json_true();
19
+ if(json_equal(value1, NULL) || json_equal(NULL, value1))
20
+ fail("json_equal fails for NULL");
21
+
22
+ /* this covers true, false and null as they are singletons */
23
+ if(!json_equal(value1, value1))
24
+ fail("identical objects are not equal");
25
+ json_decref(value1);
26
+
27
+ /* integer */
28
+ value1 = json_integer(1);
29
+ value2 = json_integer(1);
30
+ if(!value1 || !value2)
31
+ fail("unable to create integers");
32
+ if(!json_equal(value1, value2))
33
+ fail("json_equal fails for two equal integers");
34
+ json_decref(value2);
35
+
36
+ value2 = json_integer(2);
37
+ if(!value2)
38
+ fail("unable to create an integer");
39
+ if(json_equal(value1, value2))
40
+ fail("json_equal fails for two inequal integers");
41
+
42
+ json_decref(value1);
43
+ json_decref(value2);
44
+
45
+ /* real */
46
+ value1 = json_real(1.2);
47
+ value2 = json_real(1.2);
48
+ if(!value1 || !value2)
49
+ fail("unable to create reals");
50
+ if(!json_equal(value1, value2))
51
+ fail("json_equal fails for two equal reals");
52
+ json_decref(value2);
53
+
54
+ value2 = json_real(3.141592);
55
+ if(!value2)
56
+ fail("unable to create an real");
57
+ if(json_equal(value1, value2))
58
+ fail("json_equal fails for two inequal reals");
59
+
60
+ json_decref(value1);
61
+ json_decref(value2);
62
+
63
+ /* string */
64
+ value1 = json_string("foo");
65
+ value2 = json_string("foo");
66
+ if(!value1 || !value2)
67
+ fail("unable to create strings");
68
+ if(!json_equal(value1, value2))
69
+ fail("json_equal fails for two equal strings");
70
+ json_decref(value2);
71
+
72
+ value2 = json_string("bar");
73
+ if(!value2)
74
+ fail("unable to create an string");
75
+ if(json_equal(value1, value2))
76
+ fail("json_equal fails for two inequal strings");
77
+
78
+ json_decref(value1);
79
+ json_decref(value2);
80
+ }
81
+
82
+ static void test_equal_array()
83
+ {
84
+ json_t *array1, *array2;
85
+
86
+ array1 = json_array();
87
+ array2 = json_array();
88
+ if(!array1 || !array2)
89
+ fail("unable to create arrays");
90
+
91
+ if(!json_equal(array1, array2))
92
+ fail("json_equal fails for two empty arrays");
93
+
94
+ json_array_append_new(array1, json_integer(1));
95
+ json_array_append_new(array2, json_integer(1));
96
+ json_array_append_new(array1, json_string("foo"));
97
+ json_array_append_new(array2, json_string("foo"));
98
+ json_array_append_new(array1, json_integer(2));
99
+ json_array_append_new(array2, json_integer(2));
100
+ if(!json_equal(array1, array2))
101
+ fail("json_equal fails for two equal arrays");
102
+
103
+ json_array_remove(array2, 2);
104
+ if(json_equal(array1, array2))
105
+ fail("json_equal fails for two inequal arrays");
106
+
107
+ json_array_append_new(array2, json_integer(3));
108
+ if(json_equal(array1, array2))
109
+ fail("json_equal fails for two inequal arrays");
110
+
111
+ json_decref(array1);
112
+ json_decref(array2);
113
+ }
114
+
115
+ static void test_equal_object()
116
+ {
117
+ json_t *object1, *object2;
118
+
119
+ object1 = json_object();
120
+ object2 = json_object();
121
+ if(!object1 || !object2)
122
+ fail("unable to create objects");
123
+
124
+ if(!json_equal(object1, object2))
125
+ fail("json_equal fails for two empty objects");
126
+
127
+ json_object_set_new(object1, "a", json_integer(1));
128
+ json_object_set_new(object2, "a", json_integer(1));
129
+ json_object_set_new(object1, "b", json_string("foo"));
130
+ json_object_set_new(object2, "b", json_string("foo"));
131
+ json_object_set_new(object1, "c", json_integer(2));
132
+ json_object_set_new(object2, "c", json_integer(2));
133
+ if(!json_equal(object1, object2))
134
+ fail("json_equal fails for two equal objects");
135
+
136
+ json_object_del(object2, "c");
137
+ if(json_equal(object1, object2))
138
+ fail("json_equal fails for two inequal objects");
139
+
140
+ json_object_set_new(object2, "c", json_integer(3));
141
+ if(json_equal(object1, object2))
142
+ fail("json_equal fails for two inequal objects");
143
+
144
+ json_object_del(object2, "c");
145
+ json_object_set_new(object2, "d", json_integer(2));
146
+ if(json_equal(object1, object2))
147
+ fail("json_equal fails for two inequal objects");
148
+
149
+ json_decref(object1);
150
+ json_decref(object2);
151
+ }
152
+
153
+ static void test_equal_complex()
154
+ {
155
+ json_t *value1, *value2;
156
+
157
+ const char *complex_json =
158
+ "{"
159
+ " \"integer\": 1, "
160
+ " \"real\": 3.141592, "
161
+ " \"string\": \"foobar\", "
162
+ " \"true\": true, "
163
+ " \"object\": {"
164
+ " \"array-in-object\": [1,true,\"foo\",{}],"
165
+ " \"object-in-object\": {\"foo\": \"bar\"}"
166
+ " },"
167
+ " \"array\": [\"foo\", false, null, 1.234]"
168
+ "}";
169
+
170
+ value1 = json_loads(complex_json, 0, NULL);
171
+ value2 = json_loads(complex_json, 0, NULL);
172
+ if(!value1 || !value2)
173
+ fail("unable to parse JSON");
174
+ if(!json_equal(value1, value2))
175
+ fail("json_equal fails for two inequal strings");
176
+
177
+ json_decref(value1);
178
+ json_decref(value2);
179
+
180
+ /* TODO: There's no negative test case here */
181
+ }
182
+
183
+ static void run_tests()
184
+ {
185
+ test_equal_simple();
186
+ test_equal_array();
187
+ test_equal_object();
188
+ test_equal_complex();
189
+ }
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
3
+ *
4
+ * Jansson is free software; you can redistribute it and/or modify
5
+ * it under the terms of the MIT license. See LICENSE for details.
6
+ */
7
+
8
+ #include <jansson.h>
9
+ #include <string.h>
10
+ #include "util.h"
11
+
12
+ static void file_not_found()
13
+ {
14
+ json_t *json;
15
+ json_error_t error;
16
+ char *pos;
17
+
18
+ json = json_load_file("/path/to/nonexistent/file.json", 0, &error);
19
+ if(json)
20
+ fail("json_load_file returned non-NULL for a nonexistent file");
21
+ if(error.line != -1)
22
+ fail("json_load_file returned an invalid line number");
23
+
24
+ /* The error message is locale specific, only check the beginning
25
+ of the error message. */
26
+
27
+ pos = strchr(error.text, ':');
28
+ if(!pos)
29
+ fail("json_load_file returne an invalid error message");
30
+
31
+ *pos = '\0';
32
+
33
+ if(strcmp(error.text, "unable to open /path/to/nonexistent/file.json") != 0)
34
+ fail("json_load_file returned an invalid error message");
35
+ }
36
+
37
+ static void reject_duplicates()
38
+ {
39
+ json_error_t error;
40
+
41
+ if(json_loads("{\"foo\": 1, \"foo\": 2}", JSON_REJECT_DUPLICATES, &error))
42
+ fail("json_loads did not detect a duplicate key");
43
+ check_error("duplicate object key near '\"foo\"'", "<string>", 1, 16, 16);
44
+ }
45
+
46
+ static void disable_eof_check()
47
+ {
48
+ json_error_t error;
49
+ json_t *json;
50
+
51
+ const char *text = "{\"foo\": 1} garbage";
52
+
53
+ if(json_loads(text, 0, &error))
54
+ fail("json_loads did not detect garbage after JSON text");
55
+ check_error("end of file expected near 'garbage'", "<string>", 1, 18, 18);
56
+
57
+ json = json_loads(text, JSON_DISABLE_EOF_CHECK, &error);
58
+ if(!json)
59
+ fail("json_loads failed with JSON_DISABLE_EOF_CHECK");
60
+
61
+ json_decref(json);
62
+ }
63
+
64
+ static void decode_any()
65
+ {
66
+ json_t *json;
67
+ json_error_t error;
68
+
69
+ json = json_loads("\"foo\"", JSON_DECODE_ANY, &error);
70
+ if (!json || !json_is_string(json))
71
+ fail("json_load decoded any failed - string");
72
+ json_decref(json);
73
+
74
+ json = json_loads("42", JSON_DECODE_ANY, &error);
75
+ if (!json || !json_is_integer(json))
76
+ fail("json_load decoded any failed - integer");
77
+ json_decref(json);
78
+
79
+ json = json_loads("true", JSON_DECODE_ANY, &error);
80
+ if (!json || !json_is_true(json))
81
+ fail("json_load decoded any failed - boolean");
82
+ json_decref(json);
83
+
84
+ json = json_loads("null", JSON_DECODE_ANY, &error);
85
+ if (!json || !json_is_null(json))
86
+ fail("json_load decoded any failed - null");
87
+ json_decref(json);
88
+ }
89
+
90
+ static void decode_int_as_real()
91
+ {
92
+ json_t *json;
93
+ json_error_t error;
94
+
95
+ #if JSON_INTEGER_IS_LONG_LONG
96
+ const char *imprecise;
97
+ json_int_t expected;
98
+ #endif
99
+
100
+ json = json_loads("42", JSON_DECODE_INT_AS_REAL | JSON_DECODE_ANY, &error);
101
+ if (!json || !json_is_real(json) || json_real_value(json) != 42.0)
102
+ fail("json_load decode int as real failed - int");
103
+ json_decref(json);
104
+
105
+ #if JSON_INTEGER_IS_LONG_LONG
106
+ /* This number cannot be represented exactly by a double */
107
+ imprecise = "9007199254740993";
108
+ expected = 9007199254740992ll;
109
+
110
+ json = json_loads(imprecise, JSON_DECODE_INT_AS_REAL | JSON_DECODE_ANY,
111
+ &error);
112
+ if (!json || !json_is_real(json) || expected != (json_int_t)json_real_value(json))
113
+ fail("json_load decode int as real failed - expected imprecision");
114
+ json_decref(json);
115
+ #endif
116
+ }
117
+
118
+ static void load_wrong_args()
119
+ {
120
+ json_t *json;
121
+ json_error_t error;
122
+
123
+ json = json_loads(NULL, 0, &error);
124
+ if (json)
125
+ fail("json_loads should return NULL if the first argument is NULL");
126
+
127
+ json = json_loadb(NULL, 0, 0, &error);
128
+ if (json)
129
+ fail("json_loadb should return NULL if the first argument is NULL");
130
+
131
+ json = json_loadf(NULL, 0, &error);
132
+ if (json)
133
+ fail("json_loadf should return NULL if the first argument is NULL");
134
+
135
+ json = json_load_file(NULL, 0, &error);
136
+ if (json)
137
+ fail("json_loadf should return NULL if the first argument is NULL");
138
+ }
139
+
140
+ static void position()
141
+ {
142
+ json_t *json;
143
+ size_t flags = JSON_DISABLE_EOF_CHECK;
144
+ json_error_t error;
145
+
146
+ json = json_loads("{\"foo\": \"bar\"}", 0, &error);
147
+ if(error.position != 14)
148
+ fail("json_loads returned a wrong position");
149
+ json_decref(json);
150
+
151
+ json = json_loads("{\"foo\": \"bar\"} baz quux", flags, &error);
152
+ if(error.position != 14)
153
+ fail("json_loads returned a wrong position");
154
+ json_decref(json);
155
+ }
156
+
157
+ static void run_tests()
158
+ {
159
+ file_not_found();
160
+ reject_duplicates();
161
+ disable_eof_check();
162
+ decode_any();
163
+ decode_int_as_real();
164
+ load_wrong_args();
165
+ position();
166
+ }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Copyright (c) 2009-2011 Petri Lehtinen <petri@digip.org>
3
+ *
4
+ * Jansson is free software; you can redistribute it and/or modify
5
+ * it under the terms of the MIT license. See LICENSE for details.
6
+ */
7
+
8
+ #include <jansson.h>
9
+ #include <string.h>
10
+ #include <stdlib.h>
11
+ #include "util.h"
12
+
13
+ struct my_source {
14
+ const char *buf;
15
+ size_t off;
16
+ size_t cap;
17
+ };
18
+
19
+ static const char my_str[] = "[\"A\", {\"B\": \"C\", \"e\": false}, 1, null, \"foo\"]";
20
+
21
+ static size_t greedy_reader(void *buf, size_t buflen, void *arg)
22
+ {
23
+ struct my_source *s = arg;
24
+ if (buflen > s->cap - s->off)
25
+ buflen = s->cap - s->off;
26
+ if (buflen > 0) {
27
+ memcpy(buf, s->buf + s->off, buflen);
28
+ s->off += buflen;
29
+ return buflen;
30
+ } else {
31
+ return 0;
32
+ }
33
+ }
34
+
35
+ static void run_tests()
36
+ {
37
+ struct my_source s;
38
+ json_t *json;
39
+ json_error_t error;
40
+
41
+ s.off = 0;
42
+ s.cap = strlen(my_str);
43
+ s.buf = my_str;
44
+
45
+ json = json_load_callback(greedy_reader, &s, 0, &error);
46
+
47
+ if (!json)
48
+ fail("json_load_callback failed on a valid callback");
49
+ json_decref(json);
50
+
51
+ s.off = 0;
52
+ s.cap = strlen(my_str) - 1;
53
+ s.buf = my_str;
54
+
55
+ json = json_load_callback(greedy_reader, &s, 0, &error);
56
+ if (json) {
57
+ json_decref(json);
58
+ fail("json_load_callback should have failed on an incomplete stream, but it didn't");
59
+ }
60
+ if (strcmp(error.source, "<callback>") != 0) {
61
+ fail("json_load_callback returned an invalid error source");
62
+ }
63
+ if (strcmp(error.text, "']' expected near end of file") != 0) {
64
+ fail("json_load_callback returned an invalid error message for an unclosed top-level array");
65
+ }
66
+
67
+ json = json_load_callback(NULL, NULL, 0, &error);
68
+ if (json) {
69
+ json_decref(json);
70
+ fail("json_load_callback should have failed on NULL load callback, but it didn't");
71
+ }
72
+ if (strcmp(error.text, "wrong arguments") != 0) {
73
+ fail("json_load_callback returned an invalid error message for a NULL load callback");
74
+ }
75
+ }