immunio 1.2.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -5
  3. data/ext/immunio/Rakefile +14 -6
  4. data/lib/immunio/context.rb +2 -0
  5. data/lib/immunio/plugins/action_view.rb +7 -668
  6. data/lib/immunio/plugins/action_view/action_view.rb +22 -0
  7. data/lib/immunio/plugins/action_view/active_support_hash.rb +29 -0
  8. data/lib/immunio/plugins/action_view/cache_store.rb +24 -0
  9. data/lib/immunio/plugins/action_view/erubi.rb +38 -0
  10. data/lib/immunio/plugins/action_view/erubis.rb +39 -0
  11. data/lib/immunio/plugins/action_view/fragment_caching.rb +29 -0
  12. data/lib/immunio/plugins/action_view/haml.rb +46 -0
  13. data/lib/immunio/plugins/action_view/slim.rb +42 -0
  14. data/lib/immunio/plugins/action_view/template.rb +431 -0
  15. data/lib/immunio/plugins/action_view/template_rendering.rb +45 -0
  16. data/lib/immunio/plugins/http_tracker.rb +2 -0
  17. data/lib/immunio/plugins/io.rb +34 -0
  18. data/lib/immunio/version.rb +1 -1
  19. data/lua-hooks/Makefile +36 -9
  20. data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
  21. data/lua-hooks/ext/luajit/Makefile +22 -15
  22. data/lua-hooks/ext/luajit/README +2 -2
  23. data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
  24. data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
  25. data/lua-hooks/ext/luajit/doc/changes.html +69 -3
  26. data/lua-hooks/ext/luajit/doc/contact.html +10 -3
  27. data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
  28. data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
  29. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
  30. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +3 -4
  31. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
  32. data/lua-hooks/ext/luajit/doc/ext_jit.html +3 -3
  33. data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
  34. data/lua-hooks/ext/luajit/doc/extensions.html +47 -20
  35. data/lua-hooks/ext/luajit/doc/faq.html +2 -2
  36. data/lua-hooks/ext/luajit/doc/install.html +74 -45
  37. data/lua-hooks/ext/luajit/doc/luajit.html +5 -5
  38. data/lua-hooks/ext/luajit/doc/running.html +3 -3
  39. data/lua-hooks/ext/luajit/doc/status.html +13 -8
  40. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
  41. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1 -1
  42. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
  43. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1 -1
  44. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +8 -5
  45. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +66 -11
  46. data/lua-hooks/ext/luajit/dynasm/dasm_mips64.lua +12 -0
  47. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
  48. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1 -1
  49. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +1 -1
  50. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
  51. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +1 -1
  52. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +5 -1
  53. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +2 -2
  54. data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
  55. data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
  56. data/lua-hooks/ext/luajit/src/Makefile +15 -11
  57. data/lua-hooks/ext/luajit/src/Makefile.dep +16 -16
  58. data/lua-hooks/ext/luajit/src/host/buildvm.c +2 -2
  59. data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
  60. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +9 -4
  61. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +2 -2
  62. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
  63. data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +14 -3
  64. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +27 -3
  65. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
  66. data/lua-hooks/ext/luajit/src/host/genminilua.lua +6 -5
  67. data/lua-hooks/ext/luajit/src/host/minilua.c +1 -1
  68. data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
  69. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +8 -8
  70. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +2 -2
  71. data/lua-hooks/ext/luajit/src/jit/dis_arm64.lua +1216 -0
  72. data/lua-hooks/ext/luajit/src/jit/dis_arm64be.lua +12 -0
  73. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +35 -20
  74. data/lua-hooks/ext/luajit/src/jit/dis_mips64.lua +17 -0
  75. data/lua-hooks/ext/luajit/src/jit/dis_mips64el.lua +17 -0
  76. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
  77. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +2 -2
  78. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
  79. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +7 -4
  80. data/lua-hooks/ext/luajit/src/jit/dump.lua +17 -12
  81. data/lua-hooks/ext/luajit/src/jit/p.lua +3 -2
  82. data/lua-hooks/ext/luajit/src/jit/v.lua +2 -2
  83. data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
  84. data/lua-hooks/ext/luajit/src/lauxlib.h +14 -20
  85. data/lua-hooks/ext/luajit/src/lib_aux.c +38 -27
  86. data/lua-hooks/ext/luajit/src/lib_base.c +12 -5
  87. data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
  88. data/lua-hooks/ext/luajit/src/lib_debug.c +5 -5
  89. data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -2
  90. data/lua-hooks/ext/luajit/src/lib_init.c +16 -16
  91. data/lua-hooks/ext/luajit/src/lib_io.c +6 -7
  92. data/lua-hooks/ext/luajit/src/lib_jit.c +14 -4
  93. data/lua-hooks/ext/luajit/src/lib_math.c +1 -5
  94. data/lua-hooks/ext/luajit/src/lib_os.c +1 -1
  95. data/lua-hooks/ext/luajit/src/lib_package.c +14 -23
  96. data/lua-hooks/ext/luajit/src/lib_string.c +1 -5
  97. data/lua-hooks/ext/luajit/src/lib_table.c +21 -1
  98. data/lua-hooks/ext/luajit/src/lj.supp +3 -3
  99. data/lua-hooks/ext/luajit/src/lj_alloc.c +174 -83
  100. data/lua-hooks/ext/luajit/src/lj_api.c +97 -18
  101. data/lua-hooks/ext/luajit/src/lj_arch.h +54 -22
  102. data/lua-hooks/ext/luajit/src/lj_asm.c +172 -53
  103. data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
  104. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +19 -16
  105. data/lua-hooks/ext/luajit/src/lj_asm_arm64.h +2022 -0
  106. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +564 -158
  107. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +19 -18
  108. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +578 -92
  109. data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
  110. data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
  111. data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
  112. data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
  113. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
  114. data/lua-hooks/ext/luajit/src/lj_buf.c +1 -1
  115. data/lua-hooks/ext/luajit/src/lj_buf.h +1 -1
  116. data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
  117. data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
  118. data/lua-hooks/ext/luajit/src/lj_ccall.c +172 -7
  119. data/lua-hooks/ext/luajit/src/lj_ccall.h +21 -5
  120. data/lua-hooks/ext/luajit/src/lj_ccallback.c +71 -17
  121. data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
  122. data/lua-hooks/ext/luajit/src/lj_cconv.c +4 -2
  123. data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
  124. data/lua-hooks/ext/luajit/src/lj_cdata.c +7 -5
  125. data/lua-hooks/ext/luajit/src/lj_cdata.h +1 -1
  126. data/lua-hooks/ext/luajit/src/lj_clib.c +5 -5
  127. data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
  128. data/lua-hooks/ext/luajit/src/lj_cparse.c +11 -6
  129. data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
  130. data/lua-hooks/ext/luajit/src/lj_crecord.c +70 -14
  131. data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
  132. data/lua-hooks/ext/luajit/src/lj_ctype.c +1 -1
  133. data/lua-hooks/ext/luajit/src/lj_ctype.h +8 -8
  134. data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
  135. data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
  136. data/lua-hooks/ext/luajit/src/lj_def.h +6 -9
  137. data/lua-hooks/ext/luajit/src/lj_dispatch.c +3 -3
  138. data/lua-hooks/ext/luajit/src/lj_dispatch.h +2 -1
  139. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +5 -4
  140. data/lua-hooks/ext/luajit/src/lj_emit_arm64.h +419 -0
  141. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +100 -20
  142. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +4 -4
  143. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +116 -25
  144. data/lua-hooks/ext/luajit/src/lj_err.c +34 -13
  145. data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
  146. data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
  147. data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
  148. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +58 -49
  149. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
  150. data/lua-hooks/ext/luajit/src/lj_frame.h +33 -6
  151. data/lua-hooks/ext/luajit/src/lj_func.c +4 -2
  152. data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
  153. data/lua-hooks/ext/luajit/src/lj_gc.c +16 -7
  154. data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
  155. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +31 -1
  156. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
  157. data/lua-hooks/ext/luajit/src/lj_ir.c +69 -96
  158. data/lua-hooks/ext/luajit/src/lj_ir.h +29 -18
  159. data/lua-hooks/ext/luajit/src/lj_ircall.h +24 -30
  160. data/lua-hooks/ext/luajit/src/lj_iropt.h +9 -9
  161. data/lua-hooks/ext/luajit/src/lj_jit.h +67 -9
  162. data/lua-hooks/ext/luajit/src/lj_lex.c +1 -1
  163. data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
  164. data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
  165. data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
  166. data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
  167. data/lua-hooks/ext/luajit/src/lj_mcode.c +11 -10
  168. data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
  169. data/lua-hooks/ext/luajit/src/lj_meta.c +1 -1
  170. data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
  171. data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
  172. data/lua-hooks/ext/luajit/src/lj_obj.h +7 -3
  173. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
  174. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +84 -17
  175. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
  176. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +3 -3
  177. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +24 -22
  178. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +11 -6
  179. data/lua-hooks/ext/luajit/src/lj_opt_split.c +11 -2
  180. data/lua-hooks/ext/luajit/src/lj_parse.c +9 -7
  181. data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
  182. data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
  183. data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
  184. data/lua-hooks/ext/luajit/src/lj_record.c +201 -117
  185. data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
  186. data/lua-hooks/ext/luajit/src/lj_snap.c +72 -26
  187. data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
  188. data/lua-hooks/ext/luajit/src/lj_state.c +6 -6
  189. data/lua-hooks/ext/luajit/src/lj_state.h +2 -2
  190. data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
  191. data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
  192. data/lua-hooks/ext/luajit/src/lj_strfmt.c +7 -3
  193. data/lua-hooks/ext/luajit/src/lj_strfmt.h +1 -1
  194. data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +4 -3
  195. data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
  196. data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
  197. data/lua-hooks/ext/luajit/src/lj_tab.c +1 -2
  198. data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
  199. data/lua-hooks/ext/luajit/src/lj_target.h +3 -3
  200. data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
  201. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +239 -7
  202. data/lua-hooks/ext/luajit/src/lj_target_mips.h +111 -22
  203. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
  204. data/lua-hooks/ext/luajit/src/lj_target_x86.h +21 -4
  205. data/lua-hooks/ext/luajit/src/lj_trace.c +63 -18
  206. data/lua-hooks/ext/luajit/src/lj_trace.h +2 -1
  207. data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -1
  208. data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
  209. data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
  210. data/lua-hooks/ext/luajit/src/lj_vm.h +5 -1
  211. data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
  212. data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
  213. data/lua-hooks/ext/luajit/src/lj_vmmath.c +1 -1
  214. data/lua-hooks/ext/luajit/src/ljamalg.c +1 -1
  215. data/lua-hooks/ext/luajit/src/lua.h +9 -1
  216. data/lua-hooks/ext/luajit/src/luaconf.h +3 -7
  217. data/lua-hooks/ext/luajit/src/luajit.c +69 -54
  218. data/lua-hooks/ext/luajit/src/luajit.h +4 -4
  219. data/lua-hooks/ext/luajit/src/lualib.h +1 -1
  220. data/lua-hooks/ext/luajit/src/msvcbuild.bat +12 -4
  221. data/lua-hooks/ext/luajit/src/vm_arm.dasc +1 -1
  222. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +255 -32
  223. data/lua-hooks/ext/luajit/src/vm_mips.dasc +26 -23
  224. data/lua-hooks/ext/luajit/src/vm_mips64.dasc +5062 -0
  225. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +1 -1
  226. data/lua-hooks/ext/luajit/src/vm_x64.dasc +24 -25
  227. data/lua-hooks/ext/luajit/src/vm_x86.dasc +77 -4
  228. data/lua-hooks/libluahooks.darwin.a +0 -0
  229. data/lua-hooks/libluahooks.linux.a +0 -0
  230. data/lua-hooks/options.mk +1 -1
  231. metadata +37 -77
  232. data/lua-hooks/ext/all.c +0 -69
  233. data/lua-hooks/ext/libinjection/COPYING +0 -37
  234. data/lua-hooks/ext/libinjection/libinjection.h +0 -65
  235. data/lua-hooks/ext/libinjection/libinjection_html5.c +0 -847
  236. data/lua-hooks/ext/libinjection/libinjection_html5.h +0 -54
  237. data/lua-hooks/ext/libinjection/libinjection_sqli.c +0 -2301
  238. data/lua-hooks/ext/libinjection/libinjection_sqli.h +0 -295
  239. data/lua-hooks/ext/libinjection/libinjection_sqli_data.h +0 -9349
  240. data/lua-hooks/ext/libinjection/libinjection_xss.c +0 -531
  241. data/lua-hooks/ext/libinjection/libinjection_xss.h +0 -21
  242. data/lua-hooks/ext/libinjection/lualib.c +0 -145
  243. data/lua-hooks/ext/libinjection/module.mk +0 -5
  244. data/lua-hooks/ext/lpeg/HISTORY +0 -96
  245. data/lua-hooks/ext/lpeg/lpcap.c +0 -537
  246. data/lua-hooks/ext/lpeg/lpcap.h +0 -56
  247. data/lua-hooks/ext/lpeg/lpcode.c +0 -1014
  248. data/lua-hooks/ext/lpeg/lpcode.h +0 -40
  249. data/lua-hooks/ext/lpeg/lpeg-128.gif +0 -0
  250. data/lua-hooks/ext/lpeg/lpeg.html +0 -1445
  251. data/lua-hooks/ext/lpeg/lpprint.c +0 -244
  252. data/lua-hooks/ext/lpeg/lpprint.h +0 -36
  253. data/lua-hooks/ext/lpeg/lptree.c +0 -1303
  254. data/lua-hooks/ext/lpeg/lptree.h +0 -82
  255. data/lua-hooks/ext/lpeg/lptypes.h +0 -149
  256. data/lua-hooks/ext/lpeg/lpvm.c +0 -364
  257. data/lua-hooks/ext/lpeg/lpvm.h +0 -58
  258. data/lua-hooks/ext/lpeg/makefile +0 -55
  259. data/lua-hooks/ext/lpeg/module.mk +0 -6
  260. data/lua-hooks/ext/lpeg/re.html +0 -498
  261. data/lua-hooks/ext/lua-cmsgpack/.gitignore +0 -13
  262. data/lua-hooks/ext/lua-cmsgpack/CMakeLists.txt +0 -45
  263. data/lua-hooks/ext/lua-cmsgpack/README.md +0 -115
  264. data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +0 -970
  265. data/lua-hooks/ext/lua-cmsgpack/module.mk +0 -2
  266. data/lua-hooks/ext/lua-cmsgpack/test.lua +0 -570
  267. data/lua-hooks/ext/lua-snapshot/LICENSE +0 -7
  268. data/lua-hooks/ext/lua-snapshot/Makefile +0 -12
  269. data/lua-hooks/ext/lua-snapshot/README.md +0 -18
  270. data/lua-hooks/ext/lua-snapshot/dump.lua +0 -15
  271. data/lua-hooks/ext/lua-snapshot/module.mk +0 -2
  272. data/lua-hooks/ext/lua-snapshot/snapshot.c +0 -462
  273. data/lua-hooks/ext/luautf8/README.md +0 -152
  274. data/lua-hooks/ext/luautf8/lutf8lib.c +0 -1274
  275. data/lua-hooks/ext/luautf8/module.mk +0 -2
  276. data/lua-hooks/ext/luautf8/unidata.h +0 -3064
  277. data/lua-hooks/ext/module.mk +0 -15
  278. data/lua-hooks/ext/modules.h +0 -17
  279. data/lua-hooks/ext/perf/luacpu.c +0 -114
  280. data/lua-hooks/ext/perf/lualoadavg.c +0 -40
  281. data/lua-hooks/ext/perf/luameminfo.c +0 -38
  282. data/lua-hooks/ext/perf/luaoslib.c +0 -203
  283. data/lua-hooks/ext/perf/module.mk +0 -5
  284. data/lua-hooks/ext/sha1/luasha1.c +0 -74
  285. data/lua-hooks/ext/sha1/module.mk +0 -5
  286. data/lua-hooks/ext/sha1/sha1.c +0 -145
  287. data/lua-hooks/ext/sha2/luasha256.c +0 -77
  288. data/lua-hooks/ext/sha2/module.mk +0 -5
  289. data/lua-hooks/ext/sha2/sha256.c +0 -196
  290. data/lua-hooks/ext/sysutils/lua_utils.c +0 -56
  291. data/lua-hooks/ext/sysutils/module.mk +0 -2
@@ -1,2 +0,0 @@
1
- SRC += \
2
- ext/lua-cmsgpack/lua_cmsgpack.c
@@ -1,570 +0,0 @@
1
- -- lua_cmsgpack.c lib tests
2
- -- Copyright(C) 2012 Salvatore Sanfilippo, All Rights Reserved.
3
- -- See the copyright notice at the end of lua_cmsgpack.c for more information.
4
-
5
- local cmsgpack = require "cmsgpack"
6
- local ok, cmsgpack_safe = pcall(require, 'cmsgpack.safe')
7
- if not ok then cmsgpack_safe = nil end
8
-
9
- print("------------------------------------")
10
- print("Lua version: " .. (_G.jit and _G.jit.version or _G._VERSION))
11
- print("------------------------------------")
12
-
13
- local unpack = unpack or table.unpack
14
-
15
- passed = 0
16
- failed = 0
17
- skipped = 0
18
-
19
- function hex(s)
20
- local i
21
- local h = ""
22
-
23
- for i = 1, #s do
24
- h = h .. string.format("%02x",string.byte(s,i))
25
- end
26
- return h
27
- end
28
-
29
- function ascii_to_num(c)
30
- if (c >= string.byte("0") and c <= string.byte("9")) then
31
- return c - string.byte("0")
32
- elseif (c >= string.byte("A") and c <= string.byte("F")) then
33
- return (c - string.byte("A"))+10
34
- elseif (c >= string.byte("a") and c <= string.byte("f")) then
35
- return (c - string.byte("a"))+10
36
- else
37
- error "Wrong input for ascii to num convertion."
38
- end
39
- end
40
-
41
- function unhex(h)
42
- local i
43
- local s = ""
44
- for i = 1, #h, 2 do
45
- high = ascii_to_num(string.byte(h,i))
46
- low = ascii_to_num(string.byte(h,i+1))
47
- s = s .. string.char((high*16)+low)
48
- end
49
- return s
50
- end
51
-
52
- function test_error(name, fn)
53
- io.write("Testing generate error '",name,"' ...")
54
- local ok, ret, err = pcall(fn)
55
- -- 'ok' is an error because we are testing for expicit *failure*
56
- if ok then
57
- print("ERROR: result ", ret, err)
58
- failed = failed+1
59
- else
60
- print("ok")
61
- passed = passed+1
62
- end
63
- end
64
-
65
- local function test_multiple(name, ...)
66
- io.write("Multiple test '",name,"' ...")
67
- if not compare_objects({...},{cmsgpack.unpack(cmsgpack.pack(...))}) then
68
- print("ERROR:", {...}, cmsgpack.unpack(cmsgpack.pack(...)))
69
- failed = failed+1
70
- else
71
- print("ok")
72
- passed = passed+1
73
- end
74
- end
75
-
76
- function test_noerror(name, fn)
77
- io.write("Testing safe calling '",name,"' ...")
78
- if not cmsgpack_safe then
79
- print("skip: no `cmsgpack.safe` module")
80
- skipped = skipped + 1
81
- return
82
- end
83
- local ok, ret, err = pcall(fn)
84
- if not ok then
85
- print("ERROR: result ", ret, err)
86
- failed = failed+1
87
- else
88
- print("ok")
89
- passed = passed+1
90
- end
91
- end
92
-
93
- function compare_objects(a,b,depth)
94
- if (type(a) == "table") then
95
- local count = 0
96
- if not depth then
97
- depth = 1
98
- elseif depth == 10 then
99
- return true -- assume if match down 10 levels, the rest is okay too
100
- end
101
- for k,v in pairs(a) do
102
- if not compare_objects(b[k],v, depth + 1) then return false end
103
- count = count + 1
104
- end
105
- -- All the 'a' keys are equal to their 'b' equivalents.
106
- -- Now we can check if there are extra fields in 'b'.
107
- for k,v in pairs(b) do count = count - 1 end
108
- if count == 0 then return true else return false end
109
- else
110
- return a == b
111
- end
112
- end
113
-
114
- function test_circular(name,obj)
115
- io.write("Circular test '",name,"' ...")
116
- if not compare_objects(obj,cmsgpack.unpack(cmsgpack.pack(obj))) then
117
- print("ERROR:", obj, cmsgpack.unpack(cmsgpack.pack(obj)))
118
- failed = failed+1
119
- else
120
- print("ok")
121
- passed = passed+1
122
- end
123
- end
124
-
125
- function test_stream(mod, name, ...)
126
- io.write("Stream test '", name, "' ...\n")
127
- if not mod then
128
- print("skip: no `cmsgpack.safe` module")
129
- skipped = skipped + 1
130
- return
131
- end
132
- local argc = select('#', ...)
133
- for i=1, argc do
134
- test_circular(name, select(i, ...))
135
- end
136
- local ret = {mod.unpack(mod.pack(unpack({...})))}
137
- for i=1, argc do
138
- local origin = select(i, ...)
139
- if (type(origin) == "table") then
140
- for k,v in pairs(origin) do
141
- local fail = not compare_objects(v, ret[i][k])
142
- if fail then
143
- print("ERRORa:", k, v, " not match ", ret[i][k])
144
- failed = failed + 1
145
- elseif not fail then
146
- print("ok; matched stream table member")
147
- passed = passed + 1
148
- end
149
- end
150
- else
151
- local fail = not compare_objects(origin, ret[i])
152
- if fail then
153
- print("ERRORc:", origin, " not match ", ret[i])
154
- failed = failed + 1
155
- elseif not fail then
156
- print("ok; matched individual stream member")
157
- passed = passed + 1
158
- end
159
- end
160
- end
161
-
162
- end
163
-
164
- function test_partial_unpack(name, count, ...)
165
- io.write("Testing partial unpack '",name,"' ...\n")
166
- local first = select(1, ...)
167
- local pack, unpacked, args, offset, cargs, ok, err
168
- if (type(first) == "table") then
169
- pack = first.p
170
- args = first.remaining
171
- offset = first.o
172
- cargs = {pack, count, offset}
173
- else
174
- pack = cmsgpack.pack(unpack({...}))
175
- args = {...}
176
- cargs = {pack, count}
177
- end
178
- if offset and offset < 0 then
179
- ok, unpacked, err = pcall(function()return {cmsgpack.unpack_limit(unpack(cargs))} end)
180
- if not ok then
181
- print("ok; received error as expected") --, unpacked)
182
- passed = passed + 1
183
- return
184
- end
185
- else
186
- unpacked = {cmsgpack.unpack_limit(unpack(cargs))}
187
- -- print ("GOT RETURNED:", unpack(unpacked))
188
- end
189
-
190
- if count == 0 and #unpacked == 1 then
191
- print("ok; received zero decodes as expected")
192
- passed = passed + 1
193
- return
194
- end
195
-
196
- if not (((#unpacked)-1) == count) then
197
- print(string.format("ERROR: received %d instead of %d objects:", (#unpacked)-1, count),
198
- unpack(select(1, unpacked)))
199
- failed = failed + 1
200
- return
201
- end
202
-
203
- for i=2, #unpacked do
204
- local origin = args[i-1]
205
- --print("Comparing ", origin, unpacked[i])
206
- if not compare_objects(origin, unpacked[i]) then
207
- print("ERROR:", origin, " not match ", unpacked[i])
208
- failed = failed + 1
209
- else
210
- print("ok; matched unpacked value to input")
211
- passed = passed + 1
212
- end
213
- end
214
-
215
- -- return the packed value and our continue offset
216
- return pack, unpacked[1]
217
- end
218
-
219
- function test_pack(name,obj,raw,optraw)
220
- io.write("Testing encoder '",name,"' ...")
221
- local result = hex(cmsgpack.pack(obj))
222
- if optraw and (result == optraw) then
223
- print("ok")
224
- passed = passed + 1
225
- elseif result ~= raw then
226
- print("ERROR:", obj, hex(cmsgpack.pack(obj)), raw)
227
- failed = failed+1
228
- else
229
- print("ok")
230
- passed = passed+1
231
- end
232
- end
233
-
234
- function test_unpack_one(name, packed, check, offset)
235
- io.write("Testing one unpack '",name,"' ...")
236
- local unpacked = {cmsgpack.unpack_one(unpack({packed, offset}))}
237
-
238
- if #unpacked > 2 then
239
- print("ERROR: unpacked more than one object:", unpack(unpacked))
240
- failed = failed + 1
241
- elseif not compare_objects(unpacked[2], check) then
242
- print("ERROR: unpacked unexpected result:", unpack(unpacked))
243
- failed = failed + 1
244
- else
245
- print("ok") --; unpacked", unpacked[2])
246
- passed = passed + 1
247
- end
248
-
249
- return unpacked[1]
250
- end
251
-
252
- function test_unpack(name,raw,obj)
253
- io.write("Testing decoder '",name,"' ...")
254
- if not compare_objects(cmsgpack.unpack(unhex(raw)),obj) then
255
- print("ERROR:", obj, raw, cmsgpack.unpack(unhex(raw)))
256
- failed = failed+1
257
- else
258
- print("ok")
259
- passed = passed+1
260
- end
261
- end
262
-
263
- function test_pack_and_unpack(name,obj,raw)
264
- test_pack(name,obj,raw)
265
- test_unpack(name,raw,obj)
266
- end
267
-
268
- local function test_global()
269
- io.write("Testing global variable ...")
270
-
271
- if _VERSION == "Lua 5.1" then
272
- if not _G.cmsgpack then
273
- print("ERROR: Lua 5.1 should set global")
274
- failed = failed+1
275
- else
276
- print("ok")
277
- passed = passed+1
278
- end
279
- else
280
- if _G.cmsgpack then
281
- print("ERROR: Lua 5.2 should not set global")
282
- failed = failed+1
283
- else
284
- print("ok")
285
- passed = passed+1
286
- end
287
- end
288
- end
289
-
290
- local function test_array()
291
- io.write("Testing array detection ...")
292
-
293
- local a = {a1 = 1, a2 = 1, a3 = 1, a4 = 1, a5 = 1, a6 = 1, a7 = 1, a8 = 1, a9 = 1}
294
- a[1] = 10 a[2] = 20 a[3] = 30
295
- a.a1,a.a2,a.a3,a.a4,a.a5,a.a6,a.a7,a.a8, a.a9 = nil
296
-
297
- local test_obj = {10,20,30}
298
- assert(compare_objects(test_obj, a))
299
-
300
- local etalon = cmsgpack.pack(test_obj)
301
- local encode = cmsgpack.pack(a)
302
-
303
- if etalon ~= encode then
304
- print("ERROR:")
305
- print("", "expected: ", hex(etalon))
306
- print("", " got: ", hex(encode))
307
- failed = failed+1
308
- else
309
- print("ok")
310
- passed = passed+1
311
- end
312
-
313
- io.write("Testing array detection ...")
314
-
315
- a = {["1"] = 20, [2] = 30, [3] = 40}
316
- encode = cmsgpack.pack(a)
317
- if etalon == encode then
318
- print("ERROR:")
319
- print("", " incorrect: ", hex(etalon))
320
- failed = failed+1
321
- else
322
- print("ok")
323
- passed = passed+1
324
- end
325
- end
326
-
327
- test_global()
328
- test_array()
329
- test_circular("positive fixnum",17);
330
- test_circular("negative fixnum",-1);
331
- test_circular("true boolean",true);
332
- test_circular("false boolean",false);
333
- test_circular("float",1.5);
334
- test_circular("positive uint8",101);
335
- test_circular("negative int8",-101);
336
- test_circular("positive uint16",20001);
337
- test_circular("negative int16",-20001);
338
- test_circular("positive uint32",20000001);
339
- test_circular("negative int32",-20000001);
340
- test_circular("positive uint64",200000000001);
341
- test_circular("negative int64",-200000000001);
342
- test_circular("uint8 max",0xff);
343
- test_circular("uint16 max",0xffff);
344
- test_circular("uint32 max",0xffffffff);
345
- test_circular("int8 min",-128);
346
- test_circular("int16 min",-32768);
347
- test_circular("int32 min",-2147483648);
348
- test_circular("nil",nil);
349
- test_circular("fix string","abc");
350
- test_circular("string16","xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab");
351
- test_circular("fix array (1)",{1,2,3,"foo"})
352
- test_circular("fix array (2)",{})
353
- test_circular("fix array (3)",{1,{},{}})
354
- test_circular("fix map",{a=5,b=10,c="string"})
355
- test_circular("positive infinity", math.huge)
356
- test_circular("negative infinity", -math.huge)
357
- test_circular("high bits", 0xFFFFFFFF)
358
- test_circular("higher bits", 0xFFFFFFFFFFFFFFFF)
359
- test_circular("high bits", -0x7FFFFFFF)
360
- test_circular("higher bits", -0x7FFFFFFFFFFFFFFF)
361
-
362
- -- The following test vectors are taken from the Javascript lib at:
363
- -- https://github.com/cuzic/MessagePack-JS/blob/master/test/test_pack.html
364
-
365
- test_pack_and_unpack("positive fixnum",0,"00")
366
- test_pack_and_unpack("negative fixnum",-1,"ff")
367
- test_pack_and_unpack("uint8",255,"ccff")
368
- test_pack_and_unpack("fix raw","a","a161")
369
- test_pack_and_unpack("fix array",{0},"9100")
370
- test_pack_and_unpack("fix map",{a=64},"81a16140")
371
- test_pack_and_unpack("nil",nil,"c0")
372
- test_pack_and_unpack("true",true,"c3")
373
- test_pack_and_unpack("false",false,"c2")
374
- test_pack_and_unpack("double",0.1,"cb3fb999999999999a")
375
- test_pack_and_unpack("uint16",32768,"cd8000")
376
- test_pack_and_unpack("uint32",1048576,"ce00100000")
377
- test_pack_and_unpack("int8",-64,"d0c0")
378
- test_pack_and_unpack("int16",-1024,"d1fc00")
379
- test_pack_and_unpack("int32",-1048576,"d2fff00000")
380
- test_pack_and_unpack("int64",-1099511627776,"d3ffffff0000000000")
381
- test_pack_and_unpack("raw16"," ","da002820202020202020202020202020202020202020202020202020202020202020202020202020202020")
382
- test_pack_and_unpack("array 16",{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},"dc001000000000000000000000000000000000")
383
-
384
- -- Regression test for issue #4, cyclic references in tables.
385
- a = {x=nil,y=5}
386
- b = {x=a}
387
- a['x'] = b
388
- pack = cmsgpack.pack(a)
389
- -- Note: the generated result isn't stable because the order of traversal for
390
- -- a table isn't defined. So far we've only noticed two serializations of a
391
- -- (and the second serialization only happens on Lua 5.3 sometimes)
392
- test_pack("regression for issue #4 output matching",a,"82a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a178c0", "82a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a178c0a17905a17905a17905a17905a17905a17905a17905a17905")
393
- test_circular("regression for issue #4 circular",a)
394
-
395
- -- test unpacking malformed input without crashing. This actually returns one integer value (the ASCII code)
396
- -- for each character in the string. We don't care about the return value, just that we don't segfault.
397
- cmsgpack.unpack("82a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17")
398
-
399
- -- Test unpacking input which may cause overflow memory access ("-1" for 32-bit size fields).
400
- -- These should cause a Lua error but not a segfault.
401
- test_error("unpack big string with missing input", function() cmsgpack.unpack("\219\255\255\255\255Z") end)
402
- test_error("unpack big array with missing input", function() cmsgpack.unpack("\221\255\255\255\255Z") end)
403
- test_error("unpack big map with missing input", function() cmsgpack.unpack("\223\255\255\255\255Z") end)
404
-
405
- -- Tests from github.com/moteus
406
- test_circular("map with number keys", {[1] = {1,2,3}})
407
- test_circular("map with string keys", {["1"] = {1,2,3}})
408
- test_circular("map with string keys", {["1"] = 20, [2] = 30, ["3"] = 40})
409
- test_circular("map with float keys", {[1.5] = {1,2,3}})
410
- test_error("unpack nil", function() cmsgpack.unpack(nil) end)
411
- test_error("unpack table", function() cmsgpack.unpack({}) end)
412
- test_error("unpack udata", function() cmsgpack.unpack(io.stdout) end)
413
- test_noerror("unpack nil", function() cmsgpack_safe.unpack(nil) end)
414
- test_noerror("unpack nil", function() cmsgpack_safe.unpack(nil) end)
415
- test_noerror("unpack table", function() cmsgpack_safe.unpack({}) end)
416
- test_noerror("unpack udata", function() cmsgpack_safe.unpack(io.stdout) end)
417
- test_multiple("two ints", 1, 2)
418
- test_multiple("holes", 1, nil, 2, nil, 4)
419
-
420
- -- Streaming/Multi-Input Tests
421
- test_stream(cmsgpack, "simple", {a=1}, {b=2}, {c=3}, 4, 5, 6, 7)
422
- test_stream(cmsgpack_safe, "safe simple", {a=1}, {b=2}, {c=3}, 4, 5, 6, 7)
423
- test_stream(cmsgpack, "oddities", {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0}, {a=64}, math.huge, -math.huge)
424
- test_stream(cmsgpack_safe, "safe oddities", {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0}, {a=64}, math.huge, -math.huge)
425
- test_stream(cmsgpack, "strange things", nil, {}, {nil}, a, b, b, b, a, a, b, {c = a, d = b})
426
- test_stream(cmsgpack_safe, "strange things", nil, {}, {nil}, a, b, b, b, a, a, b, {c = a, d = b})
427
- test_error("pack nothing", function() cmsgpack.pack() end)
428
- test_noerror("pack nothing safe", function() cmsgpack_safe.pack() end)
429
- test_circular("large object test",
430
- {A=9483, a=9483, aa=9483, aal=9483, aalii=9483, aam=9483, Aani=9483,
431
- aardvark=9483, aardwolf=9483, Aaron=9483, Aaronic=9483, Aaronical=9483,
432
- Aaronite=9483, Aaronitic=9483, Aaru=9483, Ab=9483, aba=9483, Ababdeh=9483,
433
- Ababua=9483, abac=9483, abaca=9483, abacate=9483, abacay=9483,
434
- abacinate=9483, abacination=9483, abaciscus=9483, abacist=9483,
435
- aback=9483, abactinal=9483, abactinally=9483, abaction=9483, abactor=9483,
436
- abaculus=9483, abacus=9483, Abadite=9483, abaff=9483, abaft=9483,
437
- abaisance=9483, abaiser=9483, abaissed=9483, abalienate=9483,
438
- abalienation=9483, abalone=9483, Abama=9483, abampere=9483, abandon=9483,
439
- abandonable=9483, abandoned=9483, abandonedly=9483, abandonee=9483,
440
- abandoner=9483, abandonment=9483, Abanic=9483, Abantes=9483,
441
- abaptiston=9483, Abarambo=9483, Abaris=9483, abarthrosis=9483,
442
- abarticular=9483, abarticulation=9483, abas=9483, abase=9483, abased=9483,
443
- abasedly=9483, abasedness=9483, abasement=9483, abaser=9483, Abasgi=9483,
444
- abash=9483, abashed=9483, abashedly=9483, abashedness=9483,
445
- abashless=9483, abashlessly=9483, abashment=9483, abasia=9483,
446
- abasic=9483, abask=9483, Abassin=9483, abastardize=9483, abatable=9483,
447
- abate=9483, abatement=9483, abater=9483, abatis=9483, abatised=9483,
448
- abaton=9483, abator=9483, abattoir=9483, Abatua=9483, abature=9483,
449
- abave=9483, abaxial=9483, abaxile=9483, abaze=9483, abb=9483, Abba=9483,
450
- abbacomes=9483, abbacy=9483, Abbadide=9483, abbas=9483, abbasi=9483,
451
- abbassi=9483, Abbasside=9483, abbatial=9483, abbatical=9483, abbess=9483,
452
- abbey=9483, abbeystede=9483, Abbie=9483, abbot=9483, abbotcy=9483,
453
- abbotnullius=9483, abbotship=9483, abbreviate=9483, abbreviately=9483,
454
- abbreviation=9483, abbreviator=9483, abbreviatory=9483, abbreviature=9483,
455
- Abby=9483, abcoulomb=9483, abdal=9483, abdat=9483, Abderian=9483,
456
- Abderite=9483, abdest=9483, abdicable=9483, abdicant=9483, abdicate=9483,
457
- abdication=9483, abdicative=9483, abdicator=9483, Abdiel=9483,
458
- abditive=9483, abditory=9483, abdomen=9483, abdominal=9483,
459
- Abdominales=9483, abdominalian=9483, abdominally=9483,
460
- abdominoanterior=9483, abdominocardiac=9483, abdominocentesis=9483,
461
- abdominocystic=9483, abdominogenital=9483, abdominohysterectomy=9483,
462
- abdominohysterotomy=9483, abdominoposterior=9483, abdominoscope=9483,
463
- abdominoscopy=9483, abdominothoracic=9483, abdominous=9483,
464
- abdominovaginal=9483, abdominovesical=9483, abduce=9483, abducens=9483,
465
- abducent=9483, abduct=9483, abduction=9483, abductor=9483, Abe=9483,
466
- abeam=9483, abear=9483, abearance=9483, abecedarian=9483,
467
- abecedarium=9483, abecedary=9483, abed=9483, abeigh=9483, Abel=9483,
468
- abele=9483, Abelia=9483, Abelian=9483, Abelicea=9483, Abelite=9483,
469
- abelite=9483, Abelmoschus=9483, abelmosk=9483, Abelonian=9483,
470
- abeltree=9483, Abencerrages=9483, abenteric=9483, abepithymia=9483,
471
- Aberdeen=9483, aberdevine=9483, Aberdonian=9483, Aberia=9483,
472
- aberrance=9483, aberrancy=9483, aberrant=9483, aberrate=9483,
473
- aberration=9483, aberrational=9483, aberrator=9483, aberrometer=9483,
474
- aberroscope=9483, aberuncator=9483, abet=9483, abetment=9483,
475
- abettal=9483, abettor=9483, abevacuation=9483, abey=9483, abeyance=9483,
476
- abeyancy=9483, abeyant=9483, abfarad=9483, abhenry=9483, abhiseka=9483,
477
- abhominable=9483, abhor=9483, abhorrence=9483, abhorrency=9483,
478
- abhorrent=9483, abhorrently=9483, abhorrer=9483, abhorrible=9483,
479
- abhorring=9483, Abhorson=9483, abidal=9483, abidance=9483, abide=9483,
480
- abider=9483, abidi=9483, abiding=9483, abidingly=9483, abidingness=9483,
481
- Abie=9483, Abies=9483, abietate=9483, abietene=9483, abietic=9483,
482
- abietin=9483, Abietineae=9483, abietineous=9483, abietinic=9483,
483
- Abiezer=9483, Abigail=9483, abigail=9483, abigailship=9483, abigeat=9483,
484
- abigeus=9483, abilao=9483, ability=9483, abilla=9483, abilo=9483,
485
- abintestate=9483, abiogenesis=9483, abiogenesist=9483, abiogenetic=9483,
486
- abiogenetical=9483, abiogenetically=9483, abiogenist=9483,
487
- abiogenous=9483, abiogeny=9483, abiological=9483, abiologically=9483,
488
- abiology=9483, abiosis=9483, abiotic=9483, abiotrophic=9483,
489
- abiotrophy=9483, Abipon=9483, abir=9483, abirritant=9483, abirritate=9483,
490
- abirritation=9483, abirritative=9483, abiston=9483, Abitibi=9483,
491
- abiuret=9483, abject=9483, abjectedness=9483, abjection=9483,
492
- abjective=9483, abjectly=9483, abjectness=9483, abjoint=9483,
493
- abjudge=9483, abjudicate=9483, abjudication=9483, abjunction=9483,
494
- abjunctive=9483, abjuration=9483, abjuratory=9483, abjure=9483,
495
- abjurement=9483, abjurer=9483, abkar=9483, abkari=9483, Abkhas=9483,
496
- Abkhasian=9483, ablach=9483, ablactate=9483, ablactation=9483,
497
- ablare=9483, ablastemic=9483, ablastous=9483, ablate=9483, ablation=9483,
498
- ablatitious=9483, ablatival=9483, ablative=9483, ablator=9483,
499
- ablaut=9483, ablaze=9483, able=9483, ableeze=9483, ablegate=9483,
500
- ableness=9483, ablepharia=9483, ablepharon=9483, ablepharous=9483,
501
- Ablepharus=9483, ablepsia=9483, ableptical=9483, ableptically=9483,
502
- abler=9483, ablest=9483, ablewhackets=9483, ablins=9483, abloom=9483,
503
- ablow=9483, ablude=9483, abluent=9483, ablush=9483, ablution=9483,
504
- ablutionary=9483, abluvion=9483, ably=9483, abmho=9483, Abnaki=9483,
505
- abnegate=9483, abnegation=9483, abnegative=9483, abnegator=9483,
506
- Abner=9483, abnerval=9483, abnet=9483, abneural=9483, abnormal=9483,
507
- abnormalism=9483, abnormalist=9483, abnormality=9483, abnormalize=9483,
508
- abnormally=9483, abnormalness=9483, abnormity=9483, abnormous=9483,
509
- abnumerable=9483, Abo=9483, aboard=9483, Abobra=9483, abode=9483,
510
- abodement=9483, abody=9483, abohm=9483, aboil=9483, abolish=9483,
511
- abolisher=9483, abolishment=9483, abolition=9483, abolitionary=9483,
512
- abolitionism=9483, abolitionist=9483, abolitionize=9483, abolla=9483,
513
- aboma=9483, abomasum=9483, abomasus=9483, abominable=9483,
514
- abominableness=9483, abominably=9483, abominate=9483, abomination=9483,
515
- abominator=9483, abomine=9483, Abongo=9483, aboon=9483, aborad=9483,
516
- aboral=9483, aborally=9483, abord=9483, aboriginal=9483,
517
- aboriginality=9483, aboriginally=9483, aboriginary=9483, aborigine=9483,
518
- abort=9483, aborted=9483, aborticide=9483, abortient=9483,
519
- abortifacient=9483, abortin=9483, abortion=9483, abortional=9483,
520
- abortionist=9483, abortive=9483, abortively=9483, abortiveness=9483,
521
- abortus=9483, abouchement=9483, abound=9483, abounder=9483,
522
- abounding=9483, aboundingly=9483, about=9483, abouts=9483, above=9483,
523
- aboveboard=9483, abovedeck=9483, aboveground=9483, aboveproof=9483,
524
- abovestairs=9483, abox=9483, abracadabra=9483, abrachia=9483,
525
- abradant=9483, abrade=9483, abrader=9483, Abraham=9483, Abrahamic=9483,
526
- Abrahamidae=9483, Abrahamite=9483, Abrahamitic=9483, abraid=9483,
527
- Abram=9483, Abramis=9483, abranchial=9483, abranchialism=9483,
528
- abranchian=9483, Abranchiata=9483, abranchiate=9483, abranchious=9483,
529
- abrasax=9483, abrase=9483, abrash=9483, abrasiometer=9483, abrasion=9483,
530
- abrasive=9483, abrastol=9483, abraum=9483, abraxas=9483, abreact=9483,
531
- abreaction=9483, abreast=9483, abrenounce=9483, abret=9483, abrico=9483,
532
- abridge=9483, abridgeable=9483, abridged=9483, abridgedly=9483,
533
- abridger=9483, abridgment=9483, abrim=9483, abrin=9483, abristle=9483,
534
- abroach=9483, abroad=9483, Abrocoma=9483, abrocome=9483, abrogable=9483,
535
- abrogate=9483, abrogation=9483, abrogative=9483, abrogator=9483,
536
- Abroma=9483, Abronia=9483, abrook=9483, abrotanum=9483, abrotine=9483,
537
- abrupt=9483, abruptedly=9483, abruption=9483, abruptly=9483,
538
- abruptness=9483, Abrus=9483, Absalom=9483, absampere=9483, Absaroka=9483,
539
- absarokite=9483, abscess=9483, abscessed=9483, abscession=9483,
540
- abscessroot=9483, abscind=9483, abscise=9483, abscision=9483,
541
- absciss=9483, abscissa=9483, abscissae=9483, abscisse=9483,
542
- abscission=9483, absconce=9483, abscond=9483, absconded=9483,
543
- abscondedly=9483, abscondence=9483})
544
-
545
- -- Test limited streaming
546
- packed, offset = test_partial_unpack("unpack 1a out of 7", 1, "a", "b", "c", "d", "e", "f", "g")
547
- packed, offset = test_partial_unpack("unpack 1b of remaining 7", 1, {p=packed,o=offset,remaining={"b"}})
548
- packed, offset = test_partial_unpack("unpack 1c of remaining 7", 1, {p=packed,o=offset,remaining={"c"}})
549
- packed, offset = test_partial_unpack("unpack 1d of remaining 7", 1, {p=packed,o=offset,remaining={"d"}})
550
- packed, offset = test_partial_unpack("unpack 1e of remaining 7", 1, {p=packed,o=offset,remaining={"e"}})
551
- packed, offset = test_partial_unpack("unpack 1f of remaining 7", 1, {p=packed,o=offset,remaining={"f"}})
552
- packed, offset = test_partial_unpack("unpack 1g of remaining 7", 1, {p=packed,o=offset,remaining={"g"}})
553
- packed, offset = test_partial_unpack("unpack 1nil of remaining 7", 0, {p=packed,o=offset})
554
-
555
- packed, offset = test_partial_unpack("unpack 3 out of 7", 3, "a", "b", "c", "d", "e", "f", "g")
556
- test_partial_unpack("unpack remaining 4", 4, {p=packed,o=offset,remaining={"d", "e", "f", "g"}})
557
-
558
- test_unpack_one("simple", packed, "a")
559
- offset = test_unpack_one("simple", cmsgpack.pack({f = 3, j = 2}, "m", "e", 7), {f = 3, j = 2})
560
- test_unpack_one("simple", cmsgpack.pack({f = 3, j = 2}, "m", "e", 7), "m", offset)
561
-
562
- -- Final report
563
- print()
564
- print("TEST PASSED:",passed)
565
- print("TEST FAILED:",failed)
566
- print("TEST SKIPPED:",skipped)
567
-
568
- if failed > 0 then
569
- os.exit(1)
570
- end