adjust test cases for recent changes to the lexers

This commit is contained in:
Robby Findler 2013-02-07 21:23:59 -06:00
parent 830db3c908
commit 995d4a4704
2 changed files with 80 additions and 79 deletions

View File

@ -37,12 +37,12 @@
(check-equal? (lex "#lang racket/base" #t)
`(("#lang" other 1 18 #f)
(,eof eof #f #f (proc scheme-lexer))))
(,eof eof #f #f (proc racket-lexer))))
(check-equal? (lex "#lang racket/base\n1" #t)
`(("#lang" other 1 18 #f)
("\n" white-space 18 19 (proc scheme-lexer))
("1" constant 19 20 (proc scheme-lexer))
(,eof eof #f #f (proc scheme-lexer))))
("\n" white-space 18 19 (proc racket-lexer))
("1" constant 19 20 (proc racket-lexer))
(,eof eof #f #f (proc racket-lexer))))
(check-equal? (lex ";; αα\n" #t)
`(("; αα" comment 1 6 #f)
("\n" white-space 6 7 before-lang-line)
@ -57,7 +57,7 @@
`(("; a" comment 1 5 #f)
("\n" white-space 5 6 before-lang-line)
("#lang" other 6 23 before-lang-line)
(,eof eof #f #f (proc scheme-lexer))))
(,eof eof #f #f (proc racket-lexer))))
(check-equal? (lex "#lang at-exp racket/base" #t)
`(("#lang" other 1 25 #f)
(,eof eof 25 25 ((proc scribble-lexer) . #f))))

View File

@ -22,6 +22,7 @@
((other) #\o)
((no-color) #\n)
((error) #\x)
((hash-colon-keyword) #\h)
(else
(error 'char "Given ~a" kind))))
@ -489,85 +490,85 @@ end-string
(test "#x1d+2" "cccccc") ;; should be "xxxxxx"
;; Keywords
(test "#:" "pp")
(test "#:a#:a" "pppppp")
(test "#:a #:a" "ppp ppp")
(test "#:a\t#:a" "ppp ppp")
(test "#:a\n#:a" "ppp ppp")
(test "#:a\"#:a" "pppxxxx")
(test "#:a,#:a" "pppoppp")
(test "#:a'#:a" "pppcppp" 3)
(test "#:a`#:a" "pppcppp" 3)
(test "#:a;#:a" "ppp;;;;")
(test "#:a(#:a" "ppppppp" 3)
(test "#:a)#:a" "ppppppp" 3)
(test "#:a[#:a" "ppppppp" 3)
(test "#:a]#:a" "ppppppp" 3)
(test "#:a{#:a" "ppppppp" 3)
(test "#:a}#:a" "ppppppp" 3)
(test "#:a##:a" "ppppppp")
(test "#:a.#:a" "ppppppp")
(test "#:a@#:a" "ppppppp")
(test "#:a/#:a" "ppppppp")
(test "#:a\"#:a\"#:a" "pppsssssppp")
(test "#:a1#:a" "ppppppp")
(test "#:a%#:a" "ppppppp")
(test "#:" "hh")
(test "#:a#:a" "hhhhhh")
(test "#:a #:a" "hhh hhh")
(test "#:a\t#:a" "hhh hhh")
(test "#:a\n#:a" "hhh hhh")
(test "#:a\"#:a" "hhhxxxx")
(test "#:a,#:a" "hhhohhh")
(test "#:a'#:a" "hhhchhh" 3)
(test "#:a`#:a" "hhhchhh" 3)
(test "#:a;#:a" "hhh;;;;")
(test "#:a(#:a" "hhhphhh" 3)
(test "#:a)#:a" "hhhphhh" 3)
(test "#:a[#:a" "hhhphhh" 3)
(test "#:a]#:a" "hhhphhh" 3)
(test "#:a{#:a" "hhhphhh" 3)
(test "#:a}#:a" "hhhphhh" 3)
(test "#:a##:a" "hhhhhhh")
(test "#:a.#:a" "hhhhhhh")
(test "#:a@#:a" "hhhhhhh")
(test "#:a/#:a" "hhhhhhh")
(test "#:a\"#:a\"#:a" "hhhssssshhh")
(test "#:a1#:a" "hhhhhhh")
(test "#:a%#:a" "hhhhhhh")
(test "#:1a" "pppp")
(test "#:\\8" "pppp")
(test "#:\\a" "pppp")
(test "#:\\\\" "pppp")
(test "#:a\\ a" "pppppp")
(test "#:a\\\ta" "pppppp")
(test "#:a\\\na" "pppppp")
(test "#:a\\\"a" "pppppp")
(test "#:a\\,a" "pppppp")
(test "#:a\\'a" "pppppp")
(test "#:a\\`a" "pppppp")
(test "#:a\\;a" "pppppp")
(test "#:a\\(a" "pppppp")
(test "#:a\\)a" "pppppp")
(test "#:a\\[a" "pppppp")
(test "#:a\\]a" "pppppp")
(test "#:a\\{a" "pppppp")
(test "#:a\\}a" "pppppp")
(test "#:\\|" "pppp")
(test "#:a\\|a" "pppppp")
(test "#:1a" "hhhh")
(test "#:\\8" "hhhh")
(test "#:\\a" "hhhh")
(test "#:\\\\" "hhhh")
(test "#:a\\ a" "hhhhhh")
(test "#:a\\\ta" "hhhhhh")
(test "#:a\\\na" "hhhhhh")
(test "#:a\\\"a" "hhhhhh")
(test "#:a\\,a" "hhhhhh")
(test "#:a\\'a" "hhhhhh")
(test "#:a\\`a" "hhhhhh")
(test "#:a\\;a" "hhhhhh")
(test "#:a\\(a" "hhhhhh")
(test "#:a\\)a" "hhhhhh")
(test "#:a\\[a" "hhhhhh")
(test "#:a\\]a" "hhhhhh")
(test "#:a\\{a" "hhhhhh")
(test "#:a\\}a" "hhhhhh")
(test "#:\\|" "hhhh")
(test "#:a\\|a" "hhhhhh")
(test #<<end-string
#:\ \8\ \a\\
end-string
"pppppppppppp")
(test "#:||" "pppp")
(test "#:|a|" "ppppp")
(test "#:|8|" "ppppp")
(test "#:|\\|" "ppppp")
(test "#:a| |a" "ppppppp")
(test "#:a|\t|a" "ppppppp")
(test "#:a|\n|a" "ppppppp")
(test "#:a|\"|a" "ppppppp")
(test "#:a|,|a" "ppppppp")
(test "#:a|'|a" "ppppppp")
(test "#:a|`|a" "ppppppp")
(test "#:a|;|a" "ppppppp")
(test "#:a|(|a" "ppppppp")
(test "#:a|)|a" "ppppppp")
(test "#:a|[|a" "ppppppp")
(test "#:a|]|a" "ppppppp")
(test "#:a|{|a" "ppppppp")
(test "#:a|}|a" "ppppppp")
(test "#:a|,|\\ |||\\|| se \\|\\\\|\\\\|" "pppppppppppppppppppppppppp")
(test "#:\\ ,#:a" "ppppoppp")
(test "#:| |a,#:a" "ppppppoppp")
(test "#:a#||#" "ppppppp")
(test "#:a#;1 2" "pppp;;;;")
(test "#:a#<<a" "ppppppp")
(test "#:1#!1" "pppppp")
(test "#:1+nan.0" "ppppppppp")
(test "#:-inf.0+1" "pppppppppp")
(test "#:\\#:a" "pppppp")
(test "#:#\\:a" "pppppp")
"hhhhhhhhhhhh")
(test "#:||" "hhhh")
(test "#:|a|" "hhhhh")
(test "#:|8|" "hhhhh")
(test "#:|\\|" "hhhhh")
(test "#:a| |a" "hhhhhhh")
(test "#:a|\t|a" "hhhhhhh")
(test "#:a|\n|a" "hhhhhhh")
(test "#:a|\"|a" "hhhhhhh")
(test "#:a|,|a" "hhhhhhh")
(test "#:a|'|a" "hhhhhhh")
(test "#:a|`|a" "hhhhhhh")
(test "#:a|;|a" "hhhhhhh")
(test "#:a|(|a" "hhhhhhh")
(test "#:a|)|a" "hhhhhhh")
(test "#:a|[|a" "hhhhhhh")
(test "#:a|]|a" "hhhhhhh")
(test "#:a|{|a" "hhhhhhh")
(test "#:a|}|a" "hhhhhhh")
(test "#:a|,|\\ |||\\|| se \\|\\\\|\\\\|" "hhhhhhhhhhhhhhhhhhhhhhhhhh")
(test "#:\\ ,#:a" "hhhhohhh")
(test "#:| |a,#:a" "hhhhhhohhh")
(test "#:a#||#" "hhhhhhh")
(test "#:a#;1 2" "hhhh;;;;")
(test "#:a#<<a" "hhhhhhh")
(test "#:1#!1" "hhhhhh")
(test "#:1+nan.0" "hhhhhhhhh")
(test "#:-inf.0+1" "hhhhhhhhhh")
(test "#:\\#:a" "hhhhhh")
(test "#:#\\:a" "hhhhhh")
(test "#:1.1" "ppppp")
(test "#:1.1" "hhhhh")
(test "#:a|" "xxxx")
(test "#:a#|" "xxxxx")
(test "#:a||a|, a\n\"" "xxxxxxxxxxxx")