Browse Source

Add tests for inline comments

Alois Mahdal 8 years ago
parent
commit
f6739a1bd6

+ 11
- 0
tests/inigrep_inigrep/TF_RUN View File

@@ -30,6 +30,10 @@ tf_enum_subtests() {
30 30
     echo "tricks_with_strange_naming"
31 31
     echo "strict_and_space"
32 32
     echo "strict_and_tab"
33
+    echo "inlinecmt_hash"
34
+    echo "inlinecmt_sc"
35
+    echo "inlinecmt_hash_and_strict"
36
+    echo "inlinecmt_sc_and_strict"
33 37
     echo "list_keys"
34 38
     echo "list_paths"
35 39
     echo "list_sections"
@@ -48,6 +52,9 @@ tf_name2cmd() {
48 52
     local name=$1
49 53
     local t_in="test/$name.stdin"
50 54
     local o_out="oracle/$name.stdout"
55
+    case $name in
56
+        inlinecmt_*)                t_in="test/inlinecmt.stdin" ;;
57
+    esac
51 58
     local cmd
52 59
     case $name in
53 60
         both_keys_and_sections)     cmd='inigrep -s section1 -k key1 -' ;;
@@ -73,6 +80,10 @@ tf_name2cmd() {
73 80
         tricks_with_strange_naming) cmd='inigrep -s "section with/ slash and spaces" -' ;;
74 81
         strict_and_space)           cmd='inigrep -S -s myscript -k py -' ;;
75 82
         strict_and_tab)             cmd='inigrep -S -s my_script -k py -' ;;
83
+        inlinecmt_hash)             cmd='inigrep -p joe.score -' ;;
84
+        inlinecmt_sc)               cmd='inigrep -p bob.score -' ;;
85
+        inlinecmt_hash_and_strict)  cmd='inigrep -S -p joe.catchphrase -' ;;
86
+        inlinecmt_sc_and_strict)    cmd='inigrep -S -p bob.catchphrase -' ;;
76 87
         list_keys)                  cmd='inigrep -L keys -' ;;
77 88
         list_paths)                 cmd='inigrep -l -' ;;
78 89
         list_sections)              cmd='inigrep -L sections -' ;;

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_hash.stdout View File

@@ -0,0 +1 @@
1
+0

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_hash_and_strict.stdout View File

@@ -0,0 +1 @@
1
+ I'm a C# developer    # but is a proud programmer

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_sc.stdout View File

@@ -0,0 +1 @@
1
+1024

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_sc_and_strict.stdout View File

@@ -0,0 +1 @@
1
+ hey; I'm Bob!         ; and that he's fun to meet!

+ 9
- 0
tests/inigrep_inigrep/test/inlinecmt.stdin View File

@@ -0,0 +1,9 @@
1
+[joe]                                   # He's a nice guy
2
+
3
+    score = 0                           # he can't play games
4
+    catchphrase = I'm a C# developer    # but is a proud programmer
5
+
6
+[bob]                                   ; We don't know much about him yet
7
+
8
+    score = 1024                        ; except that he pretty much beats us all ;)
9
+    catchphrase = hey; I'm Bob!         ; and that he's fun to meet!