first commit
This commit is contained in:
commit
e1c6aeeeed
42 changed files with 1305 additions and 0 deletions
10
test/cram/bug1.scfg
Normal file
10
test/cram/bug1.scfg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
"" {
|
||||
"" {
|
||||
""
|
||||
}
|
||||
"" {
|
||||
""
|
||||
}
|
||||
"" ""
|
||||
""
|
||||
}
|
||||
1
test/cram/bug2.scfg
Normal file
1
test/cram/bug2.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
1
test/cram/bug3.scfg
Normal file
1
test/cram/bug3.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
edff
|
||||
10
test/cram/dune
Normal file
10
test/cram/dune
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(cram
|
||||
(deps
|
||||
%{bin:scfg}
|
||||
bug1.scfg
|
||||
bug2.scfg
|
||||
bug3.scfg
|
||||
lex_error.scfg
|
||||
parse_start_with_newline.scfg
|
||||
(glob_files parse_error*.scfg)
|
||||
test1.scfg))
|
||||
2
test/cram/lex_error.scfg
Normal file
2
test/cram/lex_error.scfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
a "b
|
||||
"
|
||||
1
test/cram/parse_error1.scfg
Normal file
1
test/cram/parse_error1.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
a { } }
|
||||
1
test/cram/parse_error2.scfg
Normal file
1
test/cram/parse_error2.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
a {
|
||||
1
test/cram/parse_error3.scfg
Normal file
1
test/cram/parse_error3.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
a }
|
||||
1
test/cram/parse_error4.scfg
Normal file
1
test/cram/parse_error4.scfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
a {}
|
||||
4
test/cram/parse_start_with_newline.scfg
Normal file
4
test/cram/parse_start_with_newline.scfg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
wo lo lo {
|
||||
a b c
|
||||
}
|
||||
65
test/cram/test.t
Normal file
65
test/cram/test.t
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
test 1:
|
||||
$ dune exec -- scfg test1.scfg
|
||||
train Shinkansen {
|
||||
model E5 {
|
||||
max-speed 320km/h
|
||||
weight 453.5t
|
||||
lines-served Tōhoku Hokkaido
|
||||
}
|
||||
model E7 {
|
||||
max-speed 275km/h
|
||||
weight 540t
|
||||
lines-served Hokuriku Jōetsu
|
||||
}
|
||||
escapetests "A random line" "abracket{line" "anotherbracket}line" 'aquote"line' "anesc\\line" "asq'line" 'adq"line' 'asinglequote"{} \line' 'asinglequote"justewithadq' "dq\"and'sq"
|
||||
emptytests "" ""
|
||||
"an escaped name" a b c
|
||||
namewithoutparam
|
||||
p "unesc\nnewline" "unesc\rcr" "unesc\ttab"
|
||||
q "new line \n" "cr \r" "tab \t"
|
||||
}
|
||||
test 2:
|
||||
$ dune exec -- scfg parse_start_with_newline.scfg
|
||||
wo lo lo {
|
||||
a b c
|
||||
}
|
||||
lex error 1:
|
||||
$ dune exec -- scfg lex_error.scfg
|
||||
File lex_error.scfg, line 1, character 2: unexpected lexeme `"`
|
||||
[1]
|
||||
parse error 1:
|
||||
$ dune exec -- scfg parse_error1.scfg
|
||||
File parse_error1.scfg, line 1, character 2: unexpected lexeme `{`
|
||||
[1]
|
||||
parse error 2:
|
||||
$ dune exec -- scfg parse_error2.scfg
|
||||
File parse_error2.scfg, line 2, character 0: unexpected token EOF
|
||||
[1]
|
||||
parse error 3:
|
||||
$ dune exec -- scfg parse_error3.scfg
|
||||
File parse_error3.scfg, line 1, character 2: unexpected lexeme `}`
|
||||
[1]
|
||||
parse error 4:
|
||||
$ dune exec -- scfg parse_error4.scfg
|
||||
File parse_error4.scfg, line 1, character 2: unexpected lexeme `{`
|
||||
[1]
|
||||
bug 1:
|
||||
$ dune exec -- scfg bug1.scfg
|
||||
"" {
|
||||
"" {
|
||||
""
|
||||
}
|
||||
"" {
|
||||
""
|
||||
}
|
||||
"" ""
|
||||
""
|
||||
}
|
||||
bug 2:
|
||||
$ dune exec -- scfg bug2.scfg
|
||||
|
||||
|
||||
|
||||
bug 3:
|
||||
$ dune exec -- scfg bug3.scfg
|
||||
edff
|
||||
22
test/cram/test1.scfg
Normal file
22
test/cram/test1.scfg
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
train "Shinkansen" {
|
||||
model "E5" {
|
||||
max-speed 320km/h
|
||||
weight 453.5t
|
||||
|
||||
lines-served "Tōhoku" "Hokkaido"
|
||||
}
|
||||
|
||||
model "E7" {
|
||||
max-speed 275km/h
|
||||
weight 540t
|
||||
|
||||
lines-served "Hokuriku" "Jōetsu"
|
||||
}
|
||||
|
||||
escapetests "A random line" abracket\{line anotherbracket\}line aquote\"line anesc\\line asq\'line adq\"line 'asinglequote"{} \line' 'asinglequote"justewithadq' "dq\"and'sq"
|
||||
emptytests "" ''
|
||||
"an escaped name" a b c
|
||||
namewithoutparam
|
||||
p unesc\nnewline unesc\rcr unesc\ttab
|
||||
q "new line \n" "cr \r" "tab \t"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue