Artifact
b0e0ca6019a7ea1da839b4467ed502e9e24b2138 :
File
json/test.fs
— part of check-in
[531f5bc61f]
at
2019-01-16 17:45:30
on branch trunk
— Replace 0 [IF] for emacs editings with \\\
(user:
bernd
size: 1486)
0000: 5c 20 53 6f 6d 65 20 74 65 73 74 73 20 66 6f 72 \ Some tests for
0010: 20 6a 73 6f 6e 20 69 6d 70 6f 72 74 65 72 0a 0a json importer..
0020: 5c 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 \ Copyright (C)
0030: 32 30 31 38 20 20 20 42 65 72 6e 64 20 50 61 79 2018 Bernd Pay
0040: 73 61 6e 0a 0a 5c 20 54 68 69 73 20 70 72 6f 67 san..\ This prog
0050: 72 61 6d 20 69 73 20 66 72 65 65 20 73 6f 66 74 ram is free soft
0060: 77 61 72 65 3a 20 79 6f 75 20 63 61 6e 20 72 65 ware: you can re
0070: 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e distribute it an
0080: 64 2f 6f 72 20 6d 6f 64 69 66 79 0a 5c 20 69 74 d/or modify.\ it
0090: 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 under the terms
00a0: 20 6f 66 20 74 68 65 20 47 4e 55 20 41 66 66 65 of the GNU Affe
00b0: 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 ro General Publi
00c0: 63 20 4c 69 63 65 6e 73 65 20 61 73 20 70 75 62 c License as pub
00d0: 6c 69 73 68 65 64 20 62 79 0a 5c 20 74 68 65 20 lished by.\ the
00e0: 46 72 65 65 20 53 6f 66 74 77 61 72 65 20 46 6f Free Software Fo
00f0: 75 6e 64 61 74 69 6f 6e 2c 20 65 69 74 68 65 72 undation, either
0100: 20 76 65 72 73 69 6f 6e 20 33 20 6f 66 20 74 68 version 3 of th
0110: 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0a 5c 20 e License, or.\
0120: 28 61 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 (at your option)
0130: 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 any later versi
0140: 6f 6e 2e 0a 0a 5c 20 54 68 69 73 20 70 72 6f 67 on...\ This prog
0150: 72 61 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 ram is distribut
0160: 65 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 ed in the hope t
0170: 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 hat it will be u
0180: 73 65 66 75 6c 2c 0a 5c 20 62 75 74 20 57 49 54 seful,.\ but WIT
0190: 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e 54 HOUT ANY WARRANT
01a0: 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 Y; without even
01b0: 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72 72 the implied warr
01c0: 61 6e 74 79 20 6f 66 0a 5c 20 4d 45 52 43 48 41 anty of.\ MERCHA
01d0: 4e 54 41 42 49 4c 49 54 59 20 6f 72 20 46 49 54 NTABILITY or FIT
01e0: 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 NESS FOR A PARTI
01f0: 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2e 20 20 CULAR PURPOSE.
0200: 53 65 65 20 74 68 65 0a 5c 20 47 4e 55 20 41 66 See the.\ GNU Af
0210: 66 65 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 fero General Pub
0220: 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 lic License for
0230: 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a 0a 5c more details...\
0240: 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 You should have
0250: 20 72 65 63 65 69 76 65 64 20 61 20 63 6f 70 79 received a copy
0260: 20 6f 66 20 74 68 65 20 47 4e 55 20 41 66 66 65 of the GNU Affe
0270: 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 ro General Publi
0280: 63 20 4c 69 63 65 6e 73 65 0a 5c 20 61 6c 6f 6e c License.\ alon
0290: 67 20 77 69 74 68 20 74 68 69 73 20 70 72 6f 67 g with this prog
02a0: 72 61 6d 2e 20 20 49 66 20 6e 6f 74 2c 20 73 65 ram. If not, se
02b0: 65 20 3c 68 74 74 70 3a 2f 2f 77 77 77 2e 67 6e e <http://www.gn
02c0: 75 2e 6f 72 67 2f 6c 69 63 65 6e 73 65 73 2f 3e u.org/licenses/>
02d0: 2e 0a 0a 72 65 71 75 69 72 65 20 70 61 72 73 65 ...require parse
02e0: 72 2e 66 73 0a 0a 63 73 2d 73 63 6f 70 65 3a 20 r.fs..cs-scope:
02f0: 74 65 73 74 0a 0a 6f 62 6a 65 63 74 20 63 6c 61 test..object cla
0300: 73 73 7b 20 74 65 73 74 0a 20 20 20 20 66 69 65 ss{ test. fie
0310: 6c 64 3a 20 73 74 72 69 6e 67 73 5b 5d 0a 20 20 ld: strings[].
0320: 20 20 66 69 65 6c 64 3a 20 6e 75 6d 62 65 72 73 field: numbers
0330: 5b 5d 23 0a 20 20 20 20 66 69 65 6c 64 3a 20 66 []#. field: f
0340: 6c 6f 61 74 73 5b 5d 25 0a 20 20 20 20 66 69 65 loats[]%. fie
0350: 6c 64 3a 20 6f 62 6a 65 63 74 73 5b 5d 0a 7d 63 ld: objects[].}c
0360: 6c 61 73 73 0a 0a 6f 62 6a 65 63 74 20 63 6c 61 lass..object cla
0370: 73 73 7b 20 6f 62 6a 65 63 74 73 0a 20 20 20 20 ss{ objects.
0380: 24 76 61 6c 75 65 3a 20 6e 61 6d 65 24 0a 20 20 $value: name$.
0390: 20 20 76 61 6c 75 65 3a 20 6e 75 6d 62 65 72 23 value: number#
03a0: 0a 7d 63 6c 61 73 73 0a 0a 7d 73 63 6f 70 65 0a .}class..}scope.
03b0: 0a 3a 20 74 65 73 74 2d 73 63 61 6e 20 28 20 2d .: test-scan ( -
03c0: 2d 20 29 0a 20 20 20 20 5b 27 5d 20 74 65 73 74 - ). ['] test
03d0: 20 3e 62 6f 64 79 20 74 6f 20 73 63 68 65 6d 61 >body to schema
03e0: 2d 73 63 6f 70 65 0a 20 20 20 20 74 65 73 74 3a -scope. test:
03f0: 74 65 73 74 2d 63 6c 61 73 73 20 74 6f 20 6f 75 test-class to ou
0400: 74 65 72 2d 63 6c 61 73 73 0a 20 20 20 20 5b 27 ter-class. ['
0410: 5d 20 74 65 73 74 3a 74 65 73 74 20 3e 62 6f 64 ] test:test >bod
0420: 79 20 74 6f 20 73 63 68 65 6d 61 2d 77 69 64 20 y to schema-wid
0430: 3b 0a 0a 74 65 73 74 2d 73 63 61 6e 20 22 74 65 ;..test-scan "te
0440: 73 74 2e 6a 73 6f 6e 22 20 6a 73 6f 6e 2d 6c 6f st.json" json-lo
0450: 61 64 20 76 61 6c 75 65 20 74 65 73 74 2d 72 65 ad value test-re
0460: 73 75 6c 74 0a 0a 5c 5c 5c 0a 4c 6f 63 61 6c 20 sult..\\\.Local
0470: 56 61 72 69 61 62 6c 65 73 3a 0a 66 6f 72 74 68 Variables:.forth
0480: 2d 6c 6f 63 61 6c 2d 77 6f 72 64 73 3a 0a 20 20 -local-words:.
0490: 20 20 28 0a 20 20 20 20 20 28 28 22 63 6c 61 73 (. (("clas
04a0: 73 7b 22 29 20 64 65 66 69 6e 69 74 69 6f 6e 2d s{") definition-
04b0: 73 74 61 72 74 65 72 20 28 66 6f 6e 74 2d 6c 6f starter (font-lo
04c0: 63 6b 2d 6b 65 79 77 6f 72 64 2d 66 61 63 65 20 ck-keyword-face
04d0: 2e 20 31 29 0a 20 20 20 20 20 20 22 5b 20 5c 74 . 1). "[ \t
04e0: 5c 6e 5d 22 20 74 20 6e 61 6d 65 20 28 66 6f 6e \n]" t name (fon
04f0: 74 2d 6c 6f 63 6b 2d 66 75 6e 63 74 69 6f 6e 2d t-lock-function-
0500: 6e 61 6d 65 2d 66 61 63 65 20 2e 20 33 29 29 0a name-face . 3)).
0510: 20 20 20 20 20 28 28 22 7d 63 6c 61 73 73 22 29 (("}class")
0520: 20 64 65 66 69 6e 69 74 69 6f 6e 2d 65 6e 64 65 definition-ende
0530: 72 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 6b 65 79 r (font-lock-key
0540: 77 6f 72 64 2d 66 61 63 65 20 2e 20 31 29 29 0a word-face . 1)).
0550: 20 20 20 20 29 0a 66 6f 72 74 68 2d 6c 6f 63 61 ).forth-loca
0560: 6c 2d 69 6e 64 65 6e 74 2d 77 6f 72 64 73 3a 0a l-indent-words:.
0570: 20 20 20 20 28 0a 20 20 20 20 20 28 28 22 63 6c (. (("cl
0580: 61 73 73 7b 22 29 20 28 30 20 2e 20 32 29 20 28 ass{") (0 . 2) (
0590: 30 20 2e 20 32 29 29 0a 20 20 20 20 20 28 28 22 0 . 2)). (("
05a0: 7d 63 6c 61 73 73 22 29 20 28 2d 32 20 2e 20 30 }class") (-2 . 0
05b0: 29 20 28 30 20 2e 20 2d 32 29 29 0a 20 20 20 20 ) (0 . -2)).
05c0: 29 0a 45 6e 64 3a 0a 5b 54 48 45 4e 5d 0a ).End:.[THEN].