Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 170acd5

Browse files
author
Sebastian Bauersfeld
committed
Add tests for ConfigFiles library.
1 parent 1727a0c commit 170acd5

4 files changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
| | |
2+
| | separatorAndValue1 |
3+
| | separatorAndValue2 |
4+
| Can:you=spot theactual=separator? | I betitwill=take:you a moment! |
5+
| a | unicode value |
6+
| co | lon |
7+
| duplicate | value1 |
8+
| duplicate | value2 |
9+
| indented | value |
10+
| multilinename | value |
11+
| name with spaces | value with spaces |
12+
| nameAndSeparator1 | |
13+
| nameAndSeparator2 | |
14+
| nameAndSeparator3? | |
15+
| nameOnly | |
16+
| property1 | value |
17+
| property2 | value |
18+
| property3 | value |
19+
| property4 | valueWithTrailingSpaces |
20+
| property5 | multi linevalue |
21+
| sortOfEmptyButNotReally | |
22+
| space | separator |
23+
| this | is a new property because the previous line has spaces after the backslash |
24+
| thisIsANameNotAValue! | |
25+
| with | line\nbreak |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import default
2+
import semmle.code.configfiles.ConfigFiles
3+
4+
from ConfigPair cp
5+
select cp.getEffectiveName(), cp.getEffectiveValue()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public class Test { }
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
property1=value
2+
property2 =value
3+
property3 = value
4+
property4 = valueWithTrailingSpaces
5+
name\ with\ spaces = value with spaces
6+
space separator
7+
co:lon
8+
property5 = \
9+
\
10+
multi \
11+
line\
12+
value\
13+
this is a new property because the previous line has spaces after the backslash
14+
with=line\nbreak
15+
a=unicode\u0020value
16+
indented=value
17+
18+
multi\
19+
line\
20+
name=value
21+
22+
duplicate=value1
23+
nameOnly
24+
# this and the following lines
25+
# are comments or are empty \
26+
! and should thus be ignored
27+
!
28+
29+
30+
nameAndSeparator1=
31+
nameAndSeparator2:
32+
nameAndSeparator3?
33+
=
34+
:
35+
:
36+
:
37+
=separatorAndValue1
38+
:separatorAndValue2
39+
thisIsANameNotAValue!
40+
sortOfEmptyButNotReally=\
41+
\
42+
\
43+
\u0020
44+
45+
duplicate=value2
46+
47+
Can\:you\=spot\ the\
48+
actual\
49+
\=separator? I bet\
50+
it\
51+
will=\
52+
take:\
53+
you a moment!

0 commit comments

Comments
 (0)