factor/extra/peg/javascript/tokenizer/tokenizer-tests.factor

27 lines
580 B
Factor
Raw Normal View History

2008-06-18 08:42:11 -04:00
! Copyright (C) 2008 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
USING: kernel tools.test peg peg.javascript.ast peg.javascript.tokenizer accessors ;
IN: peg.javascript.tokenizer.tests
\ tokenize-javascript must-infer
2008-06-18 08:42:11 -04:00
{
V{
T{ ast-number f 123 }
";"
T{ ast-string f "hello" }
";"
T{ ast-name f "foo" }
"("
T{ ast-name f "x" }
")"
";"
}
} [
2008-07-03 23:48:52 -04:00
"123; 'hello'; foo(x);" tokenize-javascript
2008-06-18 08:42:11 -04:00
] unit-test
2008-06-29 23:20:12 -04:00
{ V{ T{ ast-regexp f "<(w+)[^>]*?)/>" "g" } } } [
2008-07-03 23:48:52 -04:00
"/<(\\w+)[^>]*?)\\/>/g" tokenize-javascript
2008-06-29 23:20:12 -04:00
] unit-test