/core/parser/parser-tests.factor

http://github.com/abeaumont/factor · Factor · 637 lines · 453 code · 152 blank · 32 comment · 17 complexity · 4202ec3bbf03250b34b44d937ec4c46b MD5 · raw file

  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. [ 1 [ 2 [ 3 ] 4 ] 5 ]
  10. [ "1\n[\n2\n[\n3\n]\n4\n]\n5" eval( -- a b c ) ]
  11. unit-test
  12. [ t t f f ]
  13. [ "t t f f" eval( -- ? ? ? ? ) ]
  14. unit-test
  15. [ "hello world" ]
  16. [ "\"hello world\"" eval( -- string ) ]
  17. unit-test
  18. [ "\n\r\t\\" ]
  19. [ "\"\\n\\r\\t\\\\\"" eval( -- string ) ]
  20. unit-test
  21. [ "hello world" ]
  22. [
  23. """#!/usr/bin/env factor
  24. "hello world" """ eval( -- string )
  25. ] unit-test
  26. [ "hello world" ]
  27. [
  28. "IN: parser.tests : hello ( -- str ) \"hello world\" ;"
  29. eval( -- ) "USE: parser.tests hello" eval( -- string )
  30. ] unit-test
  31. [ ]
  32. [ "! This is a comment, people." eval( -- ) ]
  33. unit-test
  34. ! Test escapes
  35. [ " " ]
  36. [ "\"\\u000020\"" eval( -- string ) ]
  37. unit-test
  38. [ "'" ]
  39. [ "\"\\u000027\"" eval( -- string ) ]
  40. unit-test
  41. ! Test EOL comments in multiline strings.
  42. [ "Hello" ] [ "#! This calls until-eol.\n\"Hello\"" eval( -- string ) ] unit-test
  43. [ word ] [ \ f class-of ] unit-test
  44. ! Test stack effect parsing
  45. : effect-parsing-test ( a b -- c ) + ;
  46. [ t ] [
  47. "effect-parsing-test" "parser.tests" lookup-word
  48. \ effect-parsing-test eq?
  49. ] unit-test
  50. [ T{ effect f { "a" "b" } { "c" } f } ]
  51. [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
  52. : baz ( a b -- * ) 2array throw ;
  53. [ t ]
  54. [ \ baz "declared-effect" word-prop terminated?>> ]
  55. unit-test
  56. [ ] [ "IN: parser.tests USE: math : effect-parsing-test ( a b -- d ) - ;" eval( -- ) ] unit-test
  57. [ t ] [
  58. "effect-parsing-test" "parser.tests" lookup-word
  59. \ effect-parsing-test eq?
  60. ] unit-test
  61. [ T{ effect f { "a" "b" } { "d" } f } ]
  62. [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
  63. [ "IN: parser.tests : missing-- ( a b ) ;" eval( -- ) ] must-fail
  64. ! Funny bug
  65. [ 2 ] [ "IN: parser.tests : \0. ( -- x ) 2 ; \0." eval( -- n ) ] unit-test
  66. DEFER: foo
  67. "IN: parser.tests USING: math prettyprint ; SYNTAX: foo 2 2 + . ;" eval( -- )
  68. [ ] [ "USE: parser.tests foo" eval( -- ) ] unit-test
  69. "IN: parser.tests USING: math prettyprint ; : foo ( -- ) 2 2 + . ;" eval( -- )
  70. [ t ] [
  71. "USE: parser.tests \\ foo" eval( -- word )
  72. "foo" "parser.tests" lookup-word eq?
  73. ] unit-test
  74. ! parse-tokens should do the right thing on EOF
  75. [ "USING: kernel" eval( -- ) ]
  76. [ error>> T{ unexpected { want "token" } } = ] must-fail-with
  77. ! Test smudging
  78. [ 1 ] [
  79. "IN: parser.tests : smudge-me ( -- ) ;" <string-reader> "foo"
  80. parse-stream drop
  81. "foo" source-file definitions>> first assoc-size
  82. ] unit-test
  83. [ t ] [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
  84. [ ] [
  85. "IN: parser.tests : smudge-me-more ( -- ) ;" <string-reader> "foo"
  86. parse-stream drop
  87. ] unit-test
  88. [ t ] [ "smudge-me-more" "parser.tests" lookup-word >boolean ] unit-test
  89. [ f ] [ "smudge-me" "parser.tests" lookup-word >boolean ] unit-test
  90. [ 3 ] [
  91. "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
  92. parse-stream drop
  93. "foo" source-file definitions>> first assoc-size
  94. ] unit-test
  95. [ 1 ] [
  96. "IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar"
  97. parse-stream drop
  98. "bar" source-file definitions>> first assoc-size
  99. ] unit-test
  100. [ 2 ] [
  101. "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ;" <string-reader> "foo"
  102. parse-stream drop
  103. "foo" source-file definitions>> first assoc-size
  104. ] unit-test
  105. [ t ] [
  106. array "smudge-me" "parser.tests" lookup-word order member-eq?
  107. ] unit-test
  108. [ t ] [
  109. integer "smudge-me" "parser.tests" lookup-word order member-eq?
  110. ] unit-test
  111. [ f ] [
  112. string "smudge-me" "parser.tests" lookup-word order member-eq?
  113. ] unit-test
  114. [ ] [
  115. "IN: parser.tests USE: math 2 2 +" <string-reader> "a"
  116. parse-stream drop
  117. ] unit-test
  118. [ t ] [
  119. "a" <pathname> \ + usage member?
  120. ] unit-test
  121. [ ] [
  122. "IN: parser.tests USE: math 2 2 -" <string-reader> "a"
  123. parse-stream drop
  124. ] unit-test
  125. [ f ] [
  126. "a" <pathname> \ + usage member?
  127. ] unit-test
  128. [ ] [
  129. "a" source-files get delete-at
  130. 2 [
  131. "IN: parser.tests DEFER: x : y ( -- ) x ; : x ( -- ) y ;"
  132. <string-reader> "a" parse-stream drop
  133. ] times
  134. ] unit-test
  135. "a" source-files get delete-at
  136. [
  137. "IN: parser.tests : x ( -- ) ; : y ( -- * ) 3 throw ; this is an error"
  138. <string-reader> "a" parse-stream
  139. ] [ source-file-error? ] must-fail-with
  140. [ t ] [
  141. "y" "parser.tests" lookup-word >boolean
  142. ] unit-test
  143. [ f ] [
  144. "IN: parser.tests : x ( -- ) ;"
  145. <string-reader> "a" parse-stream drop
  146. "y" "parser.tests" lookup-word
  147. ] unit-test
  148. ! Test new forward definition logic
  149. [ ] [
  150. "IN: axx : axx ( -- ) ;"
  151. <string-reader> "axx" parse-stream drop
  152. ] unit-test
  153. [ ] [
  154. "USE: axx IN: bxx : bxx ( -- ) ; : cxx ( -- ) axx bxx ;"
  155. <string-reader> "bxx" parse-stream drop
  156. ] unit-test
  157. ! So we move the bxx word to axx...
  158. [ ] [
  159. "IN: axx : axx ( -- ) ; : bxx ( -- ) ;"
  160. <string-reader> "axx" parse-stream drop
  161. ] unit-test
  162. [ t ] [ "bxx" "axx" lookup-word >boolean ] unit-test
  163. ! And reload the file that uses it...
  164. [ ] [
  165. "USE: axx IN: bxx ( -- ) : cxx ( -- ) axx bxx ;"
  166. <string-reader> "bxx" parse-stream drop
  167. ] unit-test
  168. ! And hope not to get a forward-error!
  169. ! Turning a generic into a non-generic could cause all
  170. ! kinds of funnyness
  171. [ ] [
  172. "IN: ayy USE: kernel GENERIC: ayy ( a -- b ) M: object ayy ;"
  173. <string-reader> "ayy" parse-stream drop
  174. ] unit-test
  175. [ ] [
  176. "IN: ayy USE: kernel : ayy ( -- ) ;"
  177. <string-reader> "ayy" parse-stream drop
  178. ] unit-test
  179. [ ] [
  180. "IN: azz TUPLE: my-class ; GENERIC: a-generic ( a -- b )"
  181. <string-reader> "azz" parse-stream drop
  182. ] unit-test
  183. [ ] [
  184. "USE: azz M: my-class a-generic ;"
  185. <string-reader> "azz-2" parse-stream drop
  186. ] unit-test
  187. [ ] [
  188. "IN: azz GENERIC: a-generic ( a -- b )"
  189. <string-reader> "azz" parse-stream drop
  190. ] unit-test
  191. [ ] [
  192. "USE: azz USE: math M: integer a-generic ;"
  193. <string-reader> "azz-2" parse-stream drop
  194. ] unit-test
  195. [ ] [
  196. "IN: parser.tests : <bogus-error> ( -- ) ; : bogus ( -- error ) <bogus-error> ;"
  197. <string-reader> "bogus-error" parse-stream drop
  198. ] unit-test
  199. [ ] [
  200. "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus ( -- error ) <bogus-error> ;"
  201. <string-reader> "bogus-error" parse-stream drop
  202. ] unit-test
  203. ! Problems with class predicates -vs- ordinary words
  204. [ ] [
  205. "IN: parser.tests TUPLE: killer ;"
  206. <string-reader> "removing-the-predicate" parse-stream drop
  207. ] unit-test
  208. [ ] [
  209. "IN: parser.tests GENERIC: killer? ( a -- b )"
  210. <string-reader> "removing-the-predicate" parse-stream drop
  211. ] unit-test
  212. [ t ] [
  213. "killer?" "parser.tests" lookup-word >boolean
  214. ] unit-test
  215. [
  216. "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test? ( a -- b )"
  217. <string-reader> "removing-the-predicate" parse-stream
  218. ] [ error>> error>> error>> redefine-error? ] must-fail-with
  219. [
  220. "IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;"
  221. <string-reader> "redefining-a-class-1" parse-stream
  222. ] [ error>> error>> error>> redefine-error? ] must-fail-with
  223. [ ] [
  224. "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test"
  225. <string-reader> "redefining-a-class-2" parse-stream drop
  226. ] unit-test
  227. [
  228. "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ( -- ) ;"
  229. <string-reader> "redefining-a-class-3" parse-stream drop
  230. ] [ error>> error>> error>> redefine-error? ] must-fail-with
  231. [ ] [
  232. "IN: parser.tests TUPLE: class-fwd-test ;"
  233. <string-reader> "redefining-a-class-3" parse-stream drop
  234. ] unit-test
  235. [
  236. "IN: parser.tests \\ class-fwd-test"
  237. <string-reader> "redefining-a-class-3" parse-stream drop
  238. ] [ error>> error>> error>> no-word-error? ] must-fail-with
  239. [ ] [
  240. "IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test"
  241. <string-reader> "redefining-a-class-3" parse-stream drop
  242. ] unit-test
  243. [
  244. "IN: parser.tests \\ class-fwd-test"
  245. <string-reader> "redefining-a-class-3" parse-stream drop
  246. ] [ error>> error>> error>> no-word-error? ] must-fail-with
  247. [
  248. "IN: parser.tests : foo ( -- ) ; TUPLE: foo ;"
  249. <string-reader> "redefining-a-class-4" parse-stream drop
  250. ] [ error>> error>> error>> redefine-error? ] must-fail-with
  251. [ ] [
  252. "IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval( -- )
  253. ] unit-test
  254. [
  255. "IN: parser.tests : foo ( x y -- z) 1 2 ; : bar ( a -- b ) ;" eval( -- )
  256. ] must-fail
  257. [ ] [
  258. "IN: parser.tests USE: kernel PREDICATE: foo < object ;" eval( -- )
  259. ] unit-test
  260. [ t ] [
  261. "foo" "parser.tests" lookup-word word eq?
  262. ] unit-test
  263. [ ] [
  264. [
  265. "redefining-a-class-5" forget-source
  266. "redefining-a-class-6" forget-source
  267. "redefining-a-class-7" forget-source
  268. ] with-compilation-unit
  269. ] unit-test
  270. 2 [
  271. [ ] [
  272. "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
  273. <string-reader> "redefining-a-class-5" parse-stream drop
  274. ] unit-test
  275. [ ] [
  276. "IN: parser.tests M: f foo ;"
  277. <string-reader> "redefining-a-class-6" parse-stream drop
  278. ] unit-test
  279. [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
  280. [ ] [
  281. "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
  282. <string-reader> "redefining-a-class-5" parse-stream drop
  283. ] unit-test
  284. [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
  285. [ ] [
  286. "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
  287. <string-reader> "redefining-a-class-7" parse-stream drop
  288. ] unit-test
  289. [ f ] [ f "foo" "parser.tests" lookup-word execute ] unit-test
  290. [ ] [
  291. "IN: parser.tests TUPLE: foo ;"
  292. <string-reader> "redefining-a-class-7" parse-stream drop
  293. ] unit-test
  294. [ t ] [ "foo" "parser.tests" lookup-word symbol? ] unit-test
  295. ] times
  296. [ "vocab:parser/test/assert-depth.factor" run-file ] must-fail
  297. 2 [
  298. [ ] [
  299. "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
  300. <string-reader> "d-f-s-test" parse-stream drop
  301. ] unit-test
  302. [ ] [
  303. "IN: parser.tests DEFER: d-f-s d-f-s FORGET: d-f-s SYMBOL: d-f-s d-f-s"
  304. <string-reader> "d-f-s-test" parse-stream drop
  305. ] unit-test
  306. [ ] [
  307. "IN: parser.tests DEFER: d-f-s d-f-s SYMBOL: d-f-s d-f-s"
  308. <string-reader> "d-f-s-test" parse-stream drop
  309. ] unit-test
  310. ] times
  311. [ ] [
  312. [ "this-better-not-exist" forget-vocab ] with-compilation-unit
  313. ] unit-test
  314. [
  315. "USE: this-better-not-exist" eval( -- )
  316. ] must-fail
  317. [ ": foo ;" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
  318. [ 92 ] [ "CHAR: \\" eval( -- n ) ] unit-test
  319. [ 92 ] [ "CHAR: \\\\" eval( -- n ) ] unit-test
  320. [ ] [
  321. {
  322. "IN: parser.tests"
  323. "USING: math arrays kernel ;"
  324. "GENERIC: change-combination ( obj a -- b )"
  325. "M: integer change-combination 2drop 1 ;"
  326. "M: array change-combination 2drop 2 ;"
  327. } "\n" join <string-reader> "change-combination-test" parse-stream drop
  328. ] unit-test
  329. [ ] [
  330. {
  331. "IN: parser.tests"
  332. "USING: math arrays kernel ;"
  333. "GENERIC# change-combination 1 ( obj a -- b )"
  334. "M: integer change-combination 2drop 1 ;"
  335. "M: array change-combination 2drop 2 ;"
  336. } "\n" join <string-reader> "change-combination-test" parse-stream drop
  337. ] unit-test
  338. [ 2 ] [
  339. "change-combination" "parser.tests" lookup-word
  340. "methods" word-prop assoc-size
  341. ] unit-test
  342. [ ] [
  343. 2 [
  344. "IN: parser.tests DEFER: twice-fails FORGET: twice-fails MIXIN: twice-fails"
  345. <string-reader> "twice-fails-test" parse-stream drop
  346. ] times
  347. ] unit-test
  348. [ [ ] ] [
  349. "IN: parser.tests : staging-problem-test-1 ( -- a ) 1 ; : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
  350. <string-reader> "staging-problem-test" parse-stream
  351. ] unit-test
  352. [ t ] [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
  353. [ t ] [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
  354. [ [ ] ] [
  355. "IN: parser.tests << : staging-problem-test-1 ( -- a ) 1 ; >> : staging-problem-test-2 ( -- a ) staging-problem-test-1 ;"
  356. <string-reader> "staging-problem-test" parse-stream
  357. ] unit-test
  358. [ t ] [ "staging-problem-test-1" "parser.tests" lookup-word >boolean ] unit-test
  359. [ t ] [ "staging-problem-test-2" "parser.tests" lookup-word >boolean ] unit-test
  360. [ "DEFER: blahy" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with
  361. [
  362. "IN: parser.tests SYNTAX: blahy ; FORGET: blahy" eval( -- )
  363. ] [
  364. error>> staging-violation?
  365. ] must-fail-with
  366. ! Bogus error message
  367. DEFER: blahy
  368. [ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval( -- ) ]
  369. [ error>> error>> def>> \ blahy eq? ] must-fail-with
  370. [ "CHAR: \\u9999999999999" eval( -- n ) ] must-fail
  371. SYMBOLS: a b c ;
  372. [ a ] [ a ] unit-test
  373. [ b ] [ b ] unit-test
  374. [ c ] [ c ] unit-test
  375. DEFER: blah
  376. [ ] [ "IN: parser.tests GENERIC: blah ( -- )" eval( -- ) ] unit-test
  377. [ ] [ "IN: parser.tests SYMBOLS: blah ;" eval( -- ) ] unit-test
  378. [ f ] [ \ blah generic? ] unit-test
  379. [ t ] [ \ blah symbol? ] unit-test
  380. DEFER: blah1
  381. [ "IN: parser.tests SINGLETONS: blah1 blah1 blah1 ;" eval( -- ) ]
  382. [ error>> error>> def>> \ blah1 eq? ]
  383. must-fail-with
  384. IN: qualified.tests.foo
  385. : x ( -- a ) 1 ;
  386. : y ( -- a ) 5 ;
  387. IN: qualified.tests.bar
  388. : x ( -- a ) 2 ;
  389. : y ( -- a ) 4 ;
  390. IN: qualified.tests.baz
  391. : x ( -- a ) 3 ;
  392. QUALIFIED: qualified.tests.foo
  393. QUALIFIED: qualified.tests.bar
  394. [ 1 2 3 ] [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
  395. QUALIFIED-WITH: qualified.tests.bar p
  396. [ 2 ] [ p:x ] unit-test
  397. RENAME: x qualified.tests.baz => y
  398. [ 3 ] [ y ] unit-test
  399. FROM: qualified.tests.baz => x ;
  400. [ 3 ] [ x ] unit-test
  401. [ 3 ] [ y ] unit-test
  402. EXCLUDE: qualified.tests.bar => x ;
  403. [ 3 ] [ x ] unit-test
  404. [ 4 ] [ y ] unit-test
  405. ! Two similar bugs
  406. ! Replace : def with something in << >>
  407. /* [ [ ] ] [
  408. "IN: parser.tests : was-once-a-word-bug ( -- ) ;"
  409. <string-reader> "was-once-a-word-test" parse-stream
  410. ] unit-test
  411. [ t ] [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test
  412. [ [ ] ] [
  413. "IN: parser.tests USE: words << \"was-once-a-word-bug\" \"parser.tests\" create [ ] ( -- ) define-declared >>"
  414. <string-reader> "was-once-a-word-test" parse-stream
  415. ] unit-test
  416. [ t ] [ "was-once-a-word-bug" "parser.tests" lookup-word >boolean ] unit-test */
  417. ! Replace : def with DEFER:
  418. [ [ ] ] [
  419. "IN: parser.tests : is-not-deferred ( -- ) ;"
  420. <string-reader> "is-not-deferred" parse-stream
  421. ] unit-test
  422. [ t ] [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
  423. [ f ] [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
  424. [ [ ] ] [
  425. "IN: parser.tests DEFER: is-not-deferred"
  426. <string-reader> "is-not-deferred" parse-stream
  427. ] unit-test
  428. [ t ] [ "is-not-deferred" "parser.tests" lookup-word >boolean ] unit-test
  429. [ t ] [ "is-not-deferred" "parser.tests" lookup-word deferred? ] unit-test
  430. ! Forward-reference resolution case iterated using list in the wrong direction
  431. [ [ ] ] [
  432. "IN: parser.tests.forward-ref-1 DEFER: x DEFER: y"
  433. <string-reader> "forward-ref-1" parse-stream
  434. ] unit-test
  435. [ [ ] ] [
  436. "IN: parser.tests.forward-ref-2 DEFER: x DEFER: y"
  437. <string-reader> "forward-ref-2" parse-stream
  438. ] unit-test
  439. [ [ ] ] [
  440. "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 ;"
  441. <string-reader> "forward-ref-3" parse-stream
  442. ] unit-test
  443. [ t ] [
  444. "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
  445. ] unit-test
  446. [ [ ] ] [
  447. "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 ;"
  448. <string-reader> "forward-ref-3" parse-stream
  449. ] unit-test
  450. [ f ] [
  451. "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
  452. ] unit-test
  453. [ [ ] ] [
  454. "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 ;"
  455. <string-reader> "forward-ref-3" parse-stream
  456. ] unit-test
  457. [ t ] [
  458. "z" "parser.tests.forward-ref-3" lookup-word def>> [ vocabulary>> ] map all-equal?
  459. ] unit-test
  460. [ [ dup ] ] [
  461. "USE: kernel dup" <string-reader> "unuse-test" parse-stream
  462. ] unit-test
  463. [
  464. "dup" <string-reader> "unuse-test" parse-stream
  465. ] [ error>> error>> error>> no-word-error? ] must-fail-with
  466. [
  467. "USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
  468. ] [ error>> error>> error>> no-word-error? ] must-fail-with
  469. [ ] [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test
  470. [
  471. [ "vocabs.loader.test.l" use-vocab ] must-fail
  472. [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
  473. [ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test
  474. [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> in? ] unit-test
  475. ] with-file-vocabs
  476. ! Test cases for #183
  477. [ "SINGLETON: 33" <string-reader> "class identifier test" parse-stream ]
  478. [ error>> lexer-error? ] must-fail-with
  479. [ ": 44 ( -- ) ;" <string-reader> "word identifier test" parse-stream ]
  480. [ error>> lexer-error? ] must-fail-with
  481. [ "GENERIC: 33 ( -- )" <string-reader> "generic identifier test" parse-stream ]
  482. [ error>> lexer-error? ] must-fail-with