]> gitweb.factorcode.org Git - factor.git/blob - core/parser/parser-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[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     "y" "parser.tests" lookup-word
207 ] unit-test
208
209 ! Test new forward definition logic
210 { } [
211     "IN: axx : axx ( -- ) ;"
212     <string-reader> "axx" parse-stream drop
213 ] unit-test
214
215 { } [
216     "USE: axx IN: bxx : bxx ( -- ) ; : cxx ( -- ) axx bxx ;"
217     <string-reader> "bxx" parse-stream drop
218 ] unit-test
219
220 ! So we move the bxx word to axx...
221 { } [
222     "IN: axx : axx ( -- ) ; : bxx ( -- ) ;"
223     <string-reader> "axx" parse-stream drop
224 ] unit-test
225
226 { t } [ "bxx" "axx" lookup-word >boolean ] unit-test
227
228 ! And reload the file that uses it...
229 { } [
230     "USE: axx IN: bxx ( -- ) : cxx ( -- ) axx bxx ;"
231     <string-reader> "bxx" parse-stream drop
232 ] unit-test
233
234 ! And hope not to get a forward-error!
235
236 ! Turning a generic into a non-generic could cause all
237 ! kinds of funnyness
238 { } [
239     "IN: ayy USE: kernel GENERIC: ayy ( a -- b ) M: object ayy ;"
240     <string-reader> "ayy" parse-stream drop
241 ] unit-test
242
243 { } [
244     "IN: ayy USE: kernel : ayy ( -- ) ;"
245     <string-reader> "ayy" parse-stream drop
246 ] unit-test
247
248 { } [
249     "IN: azz TUPLE: my-class ; GENERIC: a-generic ( a -- b )"
250     <string-reader> "azz" parse-stream drop
251 ] unit-test
252
253 { } [
254     "USE: azz M: my-class a-generic ;"
255     <string-reader> "azz-2" parse-stream drop
256 ] unit-test
257
258 { } [
259     "IN: azz GENERIC: a-generic ( a -- b )"
260     <string-reader> "azz" parse-stream drop
261 ] unit-test
262
263 { } [
264     "USE: azz USE: math M: integer a-generic ;"
265     <string-reader> "azz-2" parse-stream drop
266 ] unit-test
267
268 { } [
269     "IN: parser.tests : <bogus-error> ( -- ) ; : bogus ( -- error ) <bogus-error> ;"
270     <string-reader> "bogus-error" parse-stream drop
271 ] unit-test
272
273 { } [
274     "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus ( -- error ) <bogus-error> ;"
275     <string-reader> "bogus-error" parse-stream drop
276 ] unit-test
277
278 ! Problems with class predicates -vs- ordinary words
279 { } [
280     "IN: parser.tests TUPLE: killer ;"
281     <string-reader> "removing-the-predicate" parse-stream drop
282 ] unit-test
283
284 { } [
285     "IN: parser.tests GENERIC: killer? ( a -- b )"
286     <string-reader> "removing-the-predicate" parse-stream drop
287 ] unit-test
288
289 { t } [
290     "killer?" "parser.tests" lookup-word >boolean
291 ] unit-test
292
293 [
294     "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test? ( a -- b )"
295     <string-reader> "removing-the-predicate" parse-stream
296 ] [ error>> error>> error>> redefine-error? ] must-fail-with
297
298 [
299     "IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;"
300     <string-reader> "redefining-a-class-1" parse-stream
301 ] [ error>> error>> error>> redefine-error? ] must-fail-with
302
303 { } [
304     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test"
305     <string-reader> "redefining-a-class-2" parse-stream drop
306 ] unit-test
307
308 [
309     "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ( -- ) ;"
310     <string-reader> "redefining-a-class-3" parse-stream drop
311 ] [ error>> error>> error>> redefine-error? ] must-fail-with
312
313 { } [
314     "IN: parser.tests TUPLE: class-fwd-test ;"
315     <string-reader> "redefining-a-class-3" parse-stream drop
316 ] unit-test
317
318 [
319     "IN: parser.tests \\ class-fwd-test"
320     <string-reader> "redefining-a-class-3" parse-stream drop
321 ] [ error>> error>> error>> no-word-error? ] must-fail-with
322
323 { } [
324     "IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test"
325     <string-reader> "redefining-a-class-3" parse-stream drop
326 ] unit-test
327
328 [
329     "IN: parser.tests \\ class-fwd-test"
330     <string-reader> "redefining-a-class-3" parse-stream drop
331 ] [ error>> error>> error>> no-word-error? ] must-fail-with
332
333 [
334     "IN: parser.tests : foo ( -- ) ; TUPLE: foo ;"
335     <string-reader> "redefining-a-class-4" parse-stream drop
336 ] [ error>> error>> error>> redefine-error? ] must-fail-with
337
338 { } [
339     "IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval( -- )
340 ] unit-test
341
342 [
343     "IN: parser.tests : foo ( x y -- z) 1 2 ; : bar ( a -- b ) ;" eval( -- )
344 ] must-fail
345
346 { } [
347     "IN: parser.tests USE: kernel PREDICATE: foo < object ;" eval( -- )
348 ] unit-test
349
350 { t } [
351     "foo" "parser.tests" lookup-word last-word eq?
352 ] unit-test
353
354 { } [
355     [
356         "redefining-a-class-5" forget-source
357         "redefining-a-class-6" forget-source
358         "redefining-a-class-7" forget-source
359     ] with-compilation-unit
360 ] unit-test
361
362 2 [
363     [ ] [
364         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
365         <string-reader> "redefining-a-class-5" parse-stream drop
366     ] unit-test
367
368     [ ] [
369         "IN: parser.tests M: f foo ;"
370         <string-reader> "redefining-a-class-6" parse-stream drop
371     ] unit-test
372
373     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
374
375     [ ] [
376         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
377         <string-reader> "redefining-a-class-5" parse-stream drop
378     ] unit-test
379
380     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
381
382     [ ] [
383         "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
384     <string-reader> "redefining-a-class-7" parse-stream drop
385     ] unit-test
386
387     [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
388
389     [ ] [
390         "IN: parser.tests TUPLE: foo ;"
391         <string-reader> "redefining-a-class-7" parse-stream drop
392     ] unit-test
393
394     [ t ] [ "foo" "parser.tests" lookup-word symbol? ] unit-test
395 ] times
396
397 [ "vocab:parser/test/assert-depth.factor" run-file ] must-fail
398
399 2 [
400     [ ] [
401         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
402         <string-reader> "d-f-s-test" parse-stream drop
403     ] unit-test
404
405     [ ] [
406         "IN: parser.tests DEFER: d-f-s d-f-s FORGET: d-f-s SYMBOL: d-f-s d-f-s"
407         <string-reader> "d-f-s-test" parse-stream drop
408     ] unit-test
409
410     [ ] [
411         "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
412         <string-reader> "d-f-s-test" parse-stream drop
413     ] unit-test
414 ] times
415
416 { } [
417     [ "this-better-not-exist" forget-vocab ] with-compilation-unit
418 ] unit-test
419
420 [
421     "USE: this-better-not-exist" eval( -- )
422 ] must-fail
423
424 [ ": foo ;" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
425
426 { 92 } [ "CHAR: \\" eval( -- n ) ] unit-test
427 { 92 } [ "CHAR: \\\\" eval( -- n ) ] unit-test
428
429 { } [
430     {
431         "IN: parser.tests"
432         "USING: math arrays kernel ;"
433         "GENERIC: change-combination ( obj a -- b )"
434         "M: integer change-combination 2drop 1 ;"
435         "M: array change-combination 2drop 2 ;"
436     } "\n" join <string-reader> "change-combination-test" parse-stream drop
437 ] unit-test
438
439 { } [
440     {
441         "IN: parser.tests"
442         "USING: math arrays kernel ;"
443         "GENERIC# change-combination 1 ( obj a -- b )"
444         "M: integer change-combination 2drop 1 ;"
445         "M: array change-combination 2drop 2 ;"
446     } "\n" join <string-reader> "change-combination-test" parse-stream drop
447 ] unit-test
448
449 { 2 } [
450     "change-combination" "parser.tests" lookup-word
451     "methods" word-prop assoc-size
452 ] unit-test
453
454 { } [
455     2 [
456         "IN: parser.tests DEFER: twice-fails FORGET: twice-fails MIXIN: twice-fails"
457         <string-reader> "twice-fails-test" parse-stream drop
458     ] times
459 ] unit-test
460
461 { [ ] } [
462     "IN: parser.tests : staging-problem-test-1 ( -- a ) 1 ; : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
463     <string-reader> "staging-problem-test" parse-stream
464 ] unit-test
465
466 { t } [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
467
468 { t } [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
469
470 { [ ] } [
471     "IN: parser.tests << : staging-problem-test-1 ( -- a ) 1 ; >> : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
472     <string-reader> "staging-problem-test" parse-stream
473 ] unit-test
474
475 { t } [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
476
477 { t } [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
478
479 [ "DEFER: blahy" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
480
481 [
482     "IN: parser.tests SYNTAX: blahy ; FORGET: blahy" eval( -- )
483 ] [
484     error>> staging-violation?
485 ] must-fail-with
486
487 ! Bogus error message
488 DEFER: blahy
489
490 [ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval( -- ) ]
491 [ error>> error>> def>> \ blahy eq? ] must-fail-with
492
493 [ "CHAR: \\u9999999999999" eval( -- n ) ] must-fail
494
495 SYMBOLS: a b c ;
496
497 { a } [ a ] unit-test
498 { b } [ b ] unit-test
499 { c } [ c ] unit-test
500
501 DEFER: blah
502
503 { } [ "IN: parser.tests GENERIC: blah ( -- )" eval( -- ) ] unit-test
504 { } [ "IN: parser.tests SYMBOLS: blah ;" eval( -- ) ] unit-test
505
506 { f } [ \ blah generic? ] unit-test
507 { t } [ \ blah symbol? ] unit-test
508
509 DEFER: blah1
510
511 [ "IN: parser.tests SINGLETONS: blah1 blah1 blah1 ;" eval( -- ) ]
512 [ error>> error>> def>> \ blah1 eq? ]
513 must-fail-with
514
515 IN: qualified.tests.foo
516 : x ( -- a ) 1 ;
517 : y ( -- a ) 5 ;
518 IN: qualified.tests.bar
519 : x ( -- a ) 2 ;
520 : y ( -- a ) 4 ;
521 IN: qualified.tests.baz
522 : x ( -- a ) 3 ;
523
524 QUALIFIED: qualified.tests.foo
525 QUALIFIED: qualified.tests.bar
526 { 1 2 3 } [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
527
528 QUALIFIED-WITH: qualified.tests.bar p
529 { 2 } [ p:x ] unit-test
530
531 RENAME: x qualified.tests.baz => y
532 { 3 } [ y ] unit-test
533
534 FROM: qualified.tests.baz => x ;
535 { 3 } [ x ] unit-test
536 { 3 } [ y ] unit-test
537
538 EXCLUDE: qualified.tests.bar => x ;
539 { 3 } [ x ] unit-test
540 { 4 } [ y ] unit-test
541
542 ! Two similar bugs
543
544 ! Replace : def with something in << >>
545 /* { [ ] } [
546     "IN: parser.tests : was-once-a-word-bug ( -- ) ;"
547     <string-reader> "was-once-a-word-test" parse-stream
548 ] unit-test
549
550 { t } [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test
551
552 { [ ] } [
553     "IN: parser.tests USE: words << \"was-once-a-word-bug\" \"parser.tests\" create-word [ ] ( -- ) define-declared >>"
554     <string-reader> "was-once-a-word-test" parse-stream
555 ] unit-test
556
557 { t } [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test */
558
559 ! Replace : def with DEFER:
560 { [ ] } [
561     "IN: parser.tests : is-not-deferred ( -- ) ;"
562     <string-reader> "is-not-deferred" parse-stream
563 ] unit-test
564
565 { t } [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
566 { f } [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
567
568 { [ ] } [
569     "IN: parser.tests DEFER: is-not-deferred"
570     <string-reader> "is-not-deferred" parse-stream
571 ] unit-test
572
573 { t } [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
574 { t } [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
575
576 ! Forward-reference resolution case iterated using list in the wrong direction
577 { [ ] } [
578     "IN: parser.tests.forward-ref-1 DEFER: x DEFER: y"
579     <string-reader> "forward-ref-1" parse-stream
580 ] unit-test
581
582 { [ ] } [
583     "IN: parser.tests.forward-ref-2 DEFER: x DEFER: y"
584     <string-reader> "forward-ref-2" parse-stream
585 ] unit-test
586
587 { [ ] } [
588     "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 ;"
589     <string-reader> "forward-ref-3" parse-stream
590 ] unit-test
591
592 { t } [
593     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
594 ] unit-test
595
596 { [ ] } [
597     "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 ;"
598     <string-reader> "forward-ref-3" parse-stream
599 ] unit-test
600
601 { f } [
602     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
603 ] unit-test
604
605 { [ ] } [
606     "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 ;"
607     <string-reader> "forward-ref-3" parse-stream
608 ] unit-test
609
610 { t } [
611     "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
612 ] unit-test
613
614 { [ dup ] } [
615     "USE: kernel dup" <string-reader> "unuse-test" parse-stream
616 ] unit-test
617
618 [
619     "dup" <string-reader> "unuse-test" parse-stream
620 ] [ error>> error>> error>> no-word-error? ] must-fail-with
621
622 [
623     "USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
624 ] [ error>> error>> error>> no-word-error? ] must-fail-with
625
626 { } [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test
627
628 [
629     [ "vocabs.loader.test.l" use-vocab ] must-fail
630     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
631     [ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test
632     [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
633 ] with-file-vocabs
634
635 ! Test cases for #183
636 [ "SINGLETON: 33" <string-reader> "class identifier test" parse-stream ]
637 [ error>> lexer-error? ] must-fail-with
638
639 [ ": 44 ( -- ) ;" <string-reader> "word identifier test" parse-stream ]
640 [ error>> lexer-error? ] must-fail-with
641
642 [ "GENERIC: 33 ( -- )" <string-reader> "generic identifier test" parse-stream ]
643 [ error>> lexer-error? ] must-fail-with
644
645 { t } [
646     t auto-use? [
647         { private? } use-first-word?
648     ] with-variable
649 ] unit-test