mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-28 12:40:42 +00:00
Add quoted names to scanner regression test. Note: no tests for octal
escapes yet... it's possible we'll just kill support for those (I hope). git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4233 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
53cb805e44
commit
04cd960539
3 files changed
+83
No files matched your search
@@ -0,0 +1,28 @@
|
||||
chip "blah-*"
|
||||
|
||||
# keyword with some quoted names
|
||||
label "foo" "bar"
|
||||
|
||||
# keyword with escaped newline, names, and whitespace
|
||||
label \
|
||||
"foo" "bar"
|
||||
|
||||
# quoted names with full range of alpha-numeric and underscores
|
||||
label "abcdefg" "hijklmnop"
|
||||
label "qrs" "tuv"
|
||||
label "wx" "yz"
|
||||
label "a0123456789" "982lksdf"
|
||||
label "_abcd" "1234_"
|
||||
label "_" "foo_bar_baz"
|
||||
label "liajesiajef82197fjadf" "blah"
|
||||
|
||||
# quoted names with escaped characters, like C
|
||||
# bell, backspace, formfeed, newline, carriage return, h-tab, v-tab, \, ?, ', "
|
||||
label escapes "\a\b\f\n\r\t\v\\\?\'\""
|
||||
|
||||
# quoted names with escaped chars that have no special significance
|
||||
# i.e. the second string below should collapse to "hello"
|
||||
label more "\h\e\l\l\o"
|
||||
|
||||
# keyword with quoted names, immediate EOF
|
||||
label "blue" "green"
|
||||
@@ -0,0 +1,53 @@
|
||||
1: CHIP
|
||||
1: NAME: blah-*
|
||||
2: EOL
|
||||
4: LABEL
|
||||
4: NAME: foo
|
||||
4: NAME: bar
|
||||
5: EOL
|
||||
7: LABEL
|
||||
8: NAME: foo
|
||||
8: NAME: bar
|
||||
9: EOL
|
||||
11: LABEL
|
||||
11: NAME: abcdefg
|
||||
11: NAME: hijklmnop
|
||||
12: EOL
|
||||
12: LABEL
|
||||
12: NAME: qrs
|
||||
12: NAME: tuv
|
||||
13: EOL
|
||||
13: LABEL
|
||||
13: NAME: wx
|
||||
13: NAME: yz
|
||||
14: EOL
|
||||
14: LABEL
|
||||
14: NAME: a0123456789
|
||||
14: NAME: 982lksdf
|
||||
15: EOL
|
||||
15: LABEL
|
||||
15: NAME: _abcd
|
||||
15: NAME: 1234_
|
||||
16: EOL
|
||||
16: LABEL
|
||||
16: NAME: _
|
||||
16: NAME: foo_bar_baz
|
||||
17: EOL
|
||||
17: LABEL
|
||||
17: NAME: liajesiajef82197fjadf
|
||||
17: NAME: blah
|
||||
18: EOL
|
||||
21: LABEL
|
||||
21: NAME: escapes
|
||||
21: NAME:
|
||||
␍ \?'"
|
||||
22: EOL
|
||||
25: LABEL
|
||||
25: NAME: more
|
||||
25: NAME: hello
|
||||
26: EOL
|
||||
28: LABEL
|
||||
28: NAME: blue
|
||||
28: NAME: green
|
||||
28: EOL
|
||||
28: EOF
|
||||
@@ -39,6 +39,8 @@ my @scenarios = (
|
||||
desc => 'normal, unquoted names' },
|
||||
{ base => 'names-errors', status => 0,
|
||||
desc => 'invalid, unquoted names' },
|
||||
{ base => 'names-quoted', status => 0,
|
||||
desc => 'normal, quoted names' },
|
||||
);
|
||||
|
||||
plan tests => ($#scenarios + 1) * 3;
|
||||
|
||||
Reference in new issue
Block a user