]> gitweb.factorcode.org Git - factor.git/blob - core/parser/parser-tests.factor
55ea673c3c33e5f5e9dc5d664cc7c041bf567e94
[factor.git] / core / parser / parser-tests.factor
1 USING: arrays math parser tools.test kernel generic words
2 io.streams.string namespaces classes effects source-files assocs
3 sequences strings io.files io.pathnames definitions
4 continuations sorting classes.tuple compiler.units debugger
5 vocabs vocabs.loader accessors eval combinators lexer
6 vocabs.parser words.symbol multiline source-files.errors
7 tools.crossref grouping sets ;
8 IN: parser.tests
9
10 [ 1 [ 2 [ 3 ] 4 ] 5 ]
11 [ "1\n[\n2\n[\n3\n]\n4\n]\n5" eval( -- a b c ) ]
12 unit-test
13
14 [ t t f f ]
15 [ "t t f f" eval( -- ? ? ? ? ) ]
16 unit-test
17
18 [ "hello world" ]
19 [ "\"hello world\"" eval( -- string ) ]
20 unit-test
21
22 [ "\n\r\t\\" ]
23 [ "\"\\n\\r\\t\\\\\"" eval( -- string ) ]
24 unit-test
25
26 [ "hello world" ]
27 [
28 """#!/usr/bin/env factor
29 "hello world" """ eval( -- string )
30 ] unit-test
31
32 [ "hello world" ]
33 [
34     "IN: parser.tests : hello ( -- str ) \"hello world\" ;"
35     eval( -- ) "USE: parser.tests hello" eval( -- string )
36 ] unit-test
37
38 [ "IN: parser.tests : \" ( -- n ) 123 ;" eval( -- ) ]
39 [ error>> invalid-word-name? ] must-fail-with
40 [ "IN: parser.tests : \"asdf ( -- n ) 123 ;" eval( -- ) ]
41 [ error>> invalid-word-name? ] must-fail-with
42 [ "IN: parser.tests : 123 ( -- n ) 123 ;" eval( -- ) ]
43 [ error>> invalid-word-name? ] must-fail-with
44
45 [ ]
46 [ "! This is a comment, people." eval( -- ) ]
47 unit-test
48
49 ! Test escapes
50
51 [ " " ]
52 [ "\"\\u000020\"" eval( -- string ) ]
53 unit-test
54
55 [ "'" ]
56 [ "\"\\u000027\"" eval( -- string ) ]
57 unit-test
58
59 ! Test EOL comments in multiline strings.
60 [ "Hello" ] [ "#! This calls until-eol.\n\"Hello\"" eval( -- string ) ] unit-test
61
62 [ word ] [ \ f class-of ] unit-test
63
64 ! Test stack effect parsing
65
66 : effect-parsing-test ( a b -- c ) + ;
67
68 [ t ] [
69     "effect-parsing-test" "parser.tests" lookup-word
70     \ effect-parsing-test eq?
71 ] unit-test
72
73 [ T{ effect f { "a" "b" } { "c" } f } ]
74 [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
75
76 : baz ( a b -- * ) 2array throw ;
77
78 [ t ]
79 [ \ baz "declared-effect" word-prop terminated?>> ]
80 unit-test
81
82 [ ] [ "IN: parser.tests USE: math : effect-parsing-test ( a b -- d ) - ;" eval( -- ) ] unit-test
83
84 [ t ] [
85     "effect-parsing-test" "parser.tests" lookup-word
86     \ effect-parsing-test eq?
87 ] unit-test
88
89 [ T{ effect f { "a" "b" } { "d" } f } ]
90 [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
91
92 [ "IN: parser.tests : missing-- ( a b ) ;" eval( -- ) ] must-fail
93
94 ! Funny bug
95 [ 2 ] [ "IN: parser.tests : \0. ( -- x ) 2 ; \0." eval( -- n ) ] unit-test
96
97 DEFER: foo
98
99 "IN: parser.tests USING: math prettyprint ; SYNTAX: foo 2 2 + . ;" eval( -- )
100
101 [ ] [ "USE: parser.tests foo" eval( -- ) ] unit-test
102
103 "IN: parser.tests USING: math prettyprint ; : foo ( -- ) 2 2 + . ;" eval( -- )
104
105 [ t ] [
106     "USE: parser.tests \\ foo" eval( -- word )
107     "foo" "parser.tests" lookup-word eq?
108 ] unit-test
109
110 ! parse-tokens should do the right thing on EOF
111 [ "USING: kernel" eval( -- ) ]
112 [ error>> T{ unexpected { want "token" } } = ] must-fail-with
113
114 ! Test smudging
115
116 [ 1 ] [
117     "IN: parser.tests : smudge-me ( -- ) ;" <string-reader> "foo"
118     parse-stream drop
119
120     "foo" source-file definitions>> first cardinality
121 ] unit-test
122
123 [ t ] [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
124
125 [ ] [
126     "IN: parser.tests : smudge-me-more ( -- ) ;" <string-reader> "foo"
127     parse-stream drop
128 ] unit-test
129
130 [ t ] [ "smudge-me-more" "parser.tests" lookup-word >boolean ] unit-test
131 [ f ] [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
132
133 [ 3 ] [
134     "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
135     parse-stream drop
136
137     "foo" source-file definitions>> first cardinality
138 ] unit-test
139
140 [ 1 ] [
141     "IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar"
142     parse-stream drop
143
144     "bar" source-file definitions>> first cardinality
145 ] unit-test
146
147 [ 2 ] [
148     "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ;" <string-reader> "foo"
149     parse-stream drop
150
151     "foo" source-file definitions>> first cardinality
152 ] unit-test
153
154 [ t ] [
155     array "smudge-me" "parser.tests" lookup-word order member-eq?
156 ] unit-test
157
158 [ t ] [
159     integer "smudge-me" "parser.tests" lookup-word order member-eq?
160 ] unit-test
161
162 [ f ] [
163     string "smudge-me" "parser.tests" lookup-word order member-eq?
164 ] unit-test
165
166 [ ] [
167     "IN: parser.tests USE: math 2 2 +" <string-reader> "a"
168     parse-stream drop
169 ] unit-test
170
171 [ t ] [
172     "a" <pathname> \ + usage member?
173 ] unit-test
174
175 [ ] [
176     "IN: parser.tests USE: math 2 2 -" <string-reader> "a"
177     parse-stream drop
178 ] unit-test
179
180 [ f ] [
181     "a" <pathname> \ + usage member?
182 ] unit-test
183
184 [ ] [
185     "a" source-files get delete-at
186     2 [
187         "IN: parser.tests DEFER: x : y ( -- ) x ; : x ( -- ) y ;"
188         <string-reader> "a" parse-stream drop
189     ] times
190 ] unit-test
191
192 "a" source-files get delete-at
193
194 [
195     "IN: parser.tests : x ( -- ) ; : y ( -- * ) 3 throw ; this is an error"
196     <string-reader> "a" parse-stream
197 ] [ source-file-error? ] must-fail-with
198
199 [ t ] [
200     "y" "parser.tests" lookup-word >boolean
201 ] unit-test
202
203 [ f ] [
204     "IN: parser.tests : x ( -- ) ;"
205     <string-reader> "a" parse-stream drop
206     
207     "y" "parser.tests" lookup-word
208 ] unit-test
209
210 ! Test new forward definition logic
211 [ ] [
212     "IN: axx : axx ( -- ) ;"
213     <string-reader> "axx" parse-stream drop
214 ] unit-test
215
216 [ ] [
217     "USE: axx IN: bxx : bxx ( -- ) ; : cxx ( -- ) axx bxx ;"
218     <string-reader> "bxx" parse-stream drop
219 ] unit-test
220
221 ! So we move the bxx word to axx...
222 [ ] [
223     "IN: axx : axx ( -- ) ; : bxx ( -- ) ;"
224     <string-reader> "axx" parse-stream drop
225 ] unit-test
226
227 [ t ] [ "bxx" "axx" lookup-word >boolean ] unit-test
228
229 ! And reload the file that uses it...
230 [ ] [
231     "USE: axx IN: bxx ( -- ) : cxx ( -- ) axx bxx ;"
232     <string-reader> "bxx" parse-stream drop
233 ] unit-test
234
235 ! And hope not to get a forward-error!
236
237 ! Turning a generic into a non-generic could cause all
238 ! kinds of funnyness
239 [ ] [
240     "IN: ayy USE: kernel GENERIC: ayy ( a -- b ) M: object ayy ;"
241     <string-reader> "ayy" parse-stream drop
242 ] unit-test
243
244 [ ] [
245     "IN: ayy USE: kernel : ayy ( -- ) ;"
246     <string-reader> "ayy" parse-stream drop
247 ] unit-test
248
249 [ ] [
250     "IN: azz TUPLE: my-class ; GENERIC: a-generic ( a -- b )"
251     <string-reader> "azz" parse-stream drop
252 ] unit-test
253
254 [ ] [
255     "USE: azz M: my-class a-generic ;"
256     <string-reader> "azz-2" parse-stream drop
257 ] unit-test
258
259 [ ] [
260     "IN: azz GENERIC: a-generic ( a -- b )"
261     <string-reader> "azz" parse-stream drop
262 ] unit-test
263
264 [ ] [
265     "USE: azz USE: math M: integer a-generic ;"
266     <string-reader> "azz-2" parse-stream drop
267 ] unit-test
268
269 [ ] [
270     "IN: parser.tests : <bogus-error> ( -- ) ; : bogus ( -- error ) <bogus-error> ;"
271     <string-reader> "bogus-error" parse-stream drop
272 ] unit-test
273
274 [ ] [
275     "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus ( -- error ) <bogus-error> ;"
276     <string-reader> "bogus-error" parse-stream drop
277 ] unit-test
278
279 ! Problems with class predicates -vs- ordinary words
280 [ ] [
281     "IN: parser.tests TUPLE: killer ;"
282     <string-reader> "removing-the-predicate" parse-stream drop
283 ] unit-test
284
285 [ ] [
286     "IN: parser.tests GENERIC: killer? ( a -- b )"
287     <string-reader> "removing-the-predicate" parse-stream drop
288 ] unit-test
289
290 [ t ] [
291     "killer?" "parser.tests" lookup-word >boolean
292 ] unit-test
293
294 [
295     "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test? ( a -- b )"
296     <string-reader> "removing-the-predicate" parse-stream
297 ] [ error>> error>> error>> redefine-error? ] must-fail-with
298
299 [
300     "IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;"
301     <string-reader> "redefining-a-class-1" parse-stream
302 ] [ error>> error>> error>> redefine-error? ] must-fail-with
303
304 [ ] [
305     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test"
306     <string-reader> "redefining-a-class-2" parse-stream drop
307 ] unit-test
308
309 [
310     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ( -- ) ;"
311     <string-reader> "redefining-a-class-3" parse-stream drop
312 ] [ error>> error>> error>> redefine-error? ] must-fail-with
313
314 [ ] [
315     "IN: parser.tests TUPLE: class-fwd-test ;"
316     <string-reader> "redefining-a-class-3" parse-stream drop
317 ] unit-test
318
319 [
320     "IN: parser.tests \\ class-fwd-test"
321     <string-reader> "redefining-a-class-3" parse-stream drop
322 ] [ error>> error>> error>> no-word-error? ] must-fail-with
323
324 [ ] [
325     "IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test"
326     <string-reader> "redefining-a-class-3" parse-stream drop
327 ] unit-test
328
329 [
330     "IN: parser.tests \\ class-fwd-test"
331     <string-reader> "redefining-a-class-3" parse-stream drop
332 ] [ error>> error>> error>> no-word-error? ] must-fail-with
333
334 [
335     "IN: parser.tests : foo ( -- ) ; TUPLE: foo ;"
336     <string-reader> "redefining-a-class-4" parse-stream drop
337 ] [ error>> error>> error>> redefine-error? ] must-fail-with
338
339 [ ] [
340     "IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval( -- )
341 ] unit-test
342
343 [
344     "IN: parser.tests : foo ( x y -- z) 1 2 ; : bar ( a -- b ) ;" eval( -- )
345 ] must-fail
346
347 [ ] [
348     "IN: parser.tests USE: kernel PREDICATE: foo < object ;" eval( -- )
349 ] unit-test
350
351 [ t ] [
352     "foo" "parser.tests" lookup-word last-word eq?
353 ] unit-test
354
355 [ ] [
356     [
357         "redefining-a-class-5" forget-source
358         "redefining-a-class-6" forget-source
359         "redefining-a-class-7" forget-source
360     ] with-compilation-unit
361 ] unit-test
362
363 2 [
364     [ ] [
365         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
366         <string-reader> "redefining-a-class-5" parse-stream drop
367     ] unit-test
368
369     [ ] [
370         "IN: parser.tests M: f foo ;"
371         <string-reader> "redefining-a-class-6" parse-stream drop
372     ] unit-test
373
374     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
375
376     [ ] [
377         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
378         <string-reader> "redefining-a-class-5" parse-stream drop
379     ] unit-test
380
381     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
382
383     [ ] [
384         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
385     <string-reader> "redefining-a-class-7" parse-stream drop
386     ] unit-test
387
388     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
389
390     [ ] [
391         "IN: parser.tests TUPLE: foo ;"
392         <string-reader> "redefining-a-class-7" parse-stream drop
393     ] unit-test
394
395     [ t ] [ "foo" "parser.tests" lookup-word symbol? ] unit-test
396 ] times
397
398 [ "vocab:parser/test/assert-depth.factor" run-file ] must-fail
399
400 2 [
401     [ ] [
402         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
403         <string-reader> "d-f-s-test" parse-stream drop
404     ] unit-test
405
406     [ ] [
407         "IN: parser.tests DEFER: d-f-s d-f-s FORGET: d-f-s SYMBOL: d-f-s d-f-s"
408         <string-reader> "d-f-s-test" parse-stream drop
409     ] unit-test
410
411     [ ] [
412         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
413         <string-reader> "d-f-s-test" parse-stream drop
414     ] unit-test
415 ] times
416
417 [ ] [
418     [ "this-better-not-exist" forget-vocab ] with-compilation-unit
419 ] unit-test
420
421 [
422     "USE: this-better-not-exist" eval( -- )
423 ] must-fail
424
425 [ ": foo ;" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
426
427 [ 92 ] [ "CHAR: \\" eval( -- n ) ] unit-test
428 [ 92 ] [ "CHAR: \\\\" eval( -- n ) ] unit-test
429
430 [ ] [
431     {
432         "IN: parser.tests"
433         "USING: math arrays kernel ;"
434         "GENERIC: change-combination ( obj a -- b )"
435         "M: integer change-combination 2drop 1 ;"
436         "M: array change-combination 2drop 2 ;"
437     } "\n" join <string-reader> "change-combination-test" parse-stream drop
438 ] unit-test
439
440 [ ] [
441     {
442         "IN: parser.tests"
443         "USING: math arrays kernel ;"
444         "GENERIC# change-combination 1 ( obj a -- b )"
445         "M: integer change-combination 2drop 1 ;"
446         "M: array change-combination 2drop 2 ;"
447     } "\n" join <string-reader> "change-combination-test" parse-stream drop
448 ] unit-test
449
450 [ 2 ] [
451     "change-combination" "parser.tests" lookup-word
452     "methods" word-prop assoc-size
453 ] unit-test
454
455 [ ] [
456     2 [
457         "IN: parser.tests DEFER: twice-fails FORGET: twice-fails MIXIN: twice-fails"
458         <string-reader> "twice-fails-test" parse-stream drop
459     ] times
460 ] unit-test
461
462 [ [ ] ] [
463     "IN: parser.tests : staging-problem-test-1 ( -- a ) 1 ; : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
464     <string-reader> "staging-problem-test" parse-stream
465 ] unit-test
466
467 [ t ] [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
468
469 [ t ] [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
470
471 [ [ ] ] [
472     "IN: parser.tests << : staging-problem-test-1 ( -- a ) 1 ; >> : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
473     <string-reader> "staging-problem-test" parse-stream
474 ] unit-test
475
476 [ t ] [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
477
478 [ t ] [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
479
480 [ "DEFER: blahy" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
481
482 [
483     "IN: parser.tests SYNTAX: blahy ; FORGET: blahy" eval( -- )
484 ] [
485     error>> staging-violation?
486 ] must-fail-with
487
488 ! Bogus error message
489 DEFER: blahy
490
491 [ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval( -- ) ]
492 [ error>> error>> def>> \ blahy eq? ] must-fail-with
493
494 [ "CHAR: \\u9999999999999" eval( -- n ) ] must-fail
495
496 SYMBOLS: a b c ;
497
498 [ a ] [ a ] unit-test
499 [ b ] [ b ] unit-test
500 [ c ] [ c ] unit-test
501
502 DEFER: blah
503
504 [ ] [ "IN: parser.tests GENERIC: blah ( -- )" eval( -- ) ] unit-test
505 [ ] [ "IN: parser.tests SYMBOLS: blah ;" eval( -- ) ] unit-test
506
507 [ f ] [ \ blah generic? ] unit-test
508 [ t ] [ \ blah symbol? ] unit-test
509
510 DEFER: blah1
511
512 [ "IN: parser.tests SINGLETONS: blah1 blah1 blah1 ;" eval( -- ) ]
513 [ error>> error>> def>> \ blah1 eq? ]
514 must-fail-with
515
516 IN: qualified.tests.foo
517 : x ( -- a ) 1 ;
518 : y ( -- a ) 5 ;
519 IN: qualified.tests.bar
520 : x ( -- a ) 2 ;
521 : y ( -- a ) 4 ;
522 IN: qualified.tests.baz
523 : x ( -- a ) 3 ;
524
525 QUALIFIED: qualified.tests.foo
526 QUALIFIED: qualified.tests.bar
527 [ 1 2 3 ] [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
528
529 QUALIFIED-WITH: qualified.tests.bar p
530 [ 2 ] [ p:x ] unit-test
531
532 RENAME: x qualified.tests.baz => y
533 [ 3 ] [ y ] unit-test
534
535 FROM: qualified.tests.baz => x ;
536 [ 3 ] [ x ] unit-test
537 [ 3 ] [ y ] unit-test
538
539 EXCLUDE: qualified.tests.bar => x ;
540 [ 3 ] [ x ] unit-test
541 [ 4 ] [ y ] unit-test
542
543 ! Two similar bugs
544
545 ! Replace : def with something in << >>
546 /* [ [ ] ] [
547     "IN: parser.tests : was-once-a-word-bug ( -- ) ;"
548     <string-reader> "was-once-a-word-test" parse-stream
549 ] unit-test
550
551 [ t ] [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test
552
553 [ [ ] ] [
554     "IN: parser.tests USE: words << \"was-once-a-word-bug\" \"parser.tests\" create [ ] ( -- ) define-declared >>"
555     <string-reader> "was-once-a-word-test" parse-stream
556 ] unit-test
557
558 [ t ] [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test */
559
560 ! Replace : def with DEFER:
561 [ [ ] ] [
562     "IN: parser.tests : is-not-deferred ( -- ) ;"
563     <string-reader> "is-not-deferred" parse-stream
564 ] unit-test
565
566 [ t ] [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
567 [ f ] [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
568
569 [ [ ] ] [
570     "IN: parser.tests DEFER: is-not-deferred"
571     <string-reader> "is-not-deferred" parse-stream
572 ] unit-test
573
574 [ t ] [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
575 [ t ] [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
576
577 ! Forward-reference resolution case iterated using list in the wrong direction
578 [ [ ] ] [
579     "IN: parser.tests.forward-ref-1 DEFER: x DEFER: y"
580     <string-reader> "forward-ref-1" parse-stream
581 ] unit-test
582
583 [ [ ] ] [
584     "IN: parser.tests.forward-ref-2 DEFER: x DEFER: y"
585     <string-reader> "forward-ref-2" parse-stream
586 ] unit-test
587
588 [ [ ] ] [
589     "IN: parser.tests.forward-ref-3 FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; : z ( -- ) x y ;"
590     <string-reader> "forward-ref-3" parse-stream
591 ] unit-test
592
593 [ t ] [
594     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
595 ] unit-test
596
597 [ [ ] ] [
598     "FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; IN: parser.tests.forward-ref-3 : x ( -- ) ; : z ( -- ) x y ;"
599     <string-reader> "forward-ref-3" parse-stream
600 ] unit-test
601
602 [ f ] [
603     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
604 ] unit-test
605
606 [ [ ] ] [
607     "IN: parser.tests.forward-ref-3 FROM: parser.tests.forward-ref-1 => x y ; FROM: parser.tests.forward-ref-2 => x y ; : z ( -- ) x y ;"
608     <string-reader> "forward-ref-3" parse-stream
609 ] unit-test
610
611 [ t ] [
612     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
613 ] unit-test
614
615 [ [ dup ] ] [
616     "USE: kernel dup" <string-reader> "unuse-test" parse-stream
617 ] unit-test
618
619 [
620     "dup" <string-reader> "unuse-test" parse-stream
621 ] [ error>> error>> error>> no-word-error? ] must-fail-with
622
623 [
624     "USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
625 ] [ error>> error>> error>> no-word-error? ] must-fail-with
626
627 [ ] [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test
628
629 [
630     [ "vocabs.loader.test.l" use-vocab ] must-fail
631     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
632     [ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test
633     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test    
634 ] with-file-vocabs
635
636 ! Test cases for #183
637 [ "SINGLETON: 33" <string-reader> "class identifier test" parse-stream ]
638 [ error>> lexer-error? ] must-fail-with
639
640 [ ": 44 ( -- ) ;" <string-reader> "word identifier test" parse-stream ]
641 [ error>> lexer-error? ] must-fail-with
642
643 [ "GENERIC: 33 ( -- )" <string-reader> "generic identifier test" parse-stream ]
644 [ error>> lexer-error? ] must-fail-with