Ver código fonte

Add tests for inline comments

Alois Mahdal 8 anos atrás
pai
commit
f6739a1bd6

+ 11
- 0
tests/inigrep_inigrep/TF_RUN Ver arquivo

30
     echo "tricks_with_strange_naming"
30
     echo "tricks_with_strange_naming"
31
     echo "strict_and_space"
31
     echo "strict_and_space"
32
     echo "strict_and_tab"
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
     echo "list_keys"
37
     echo "list_keys"
34
     echo "list_paths"
38
     echo "list_paths"
35
     echo "list_sections"
39
     echo "list_sections"
48
     local name=$1
52
     local name=$1
49
     local t_in="test/$name.stdin"
53
     local t_in="test/$name.stdin"
50
     local o_out="oracle/$name.stdout"
54
     local o_out="oracle/$name.stdout"
55
+    case $name in
56
+        inlinecmt_*)                t_in="test/inlinecmt.stdin" ;;
57
+    esac
51
     local cmd
58
     local cmd
52
     case $name in
59
     case $name in
53
         both_keys_and_sections)     cmd='inigrep -s section1 -k key1 -' ;;
60
         both_keys_and_sections)     cmd='inigrep -s section1 -k key1 -' ;;
73
         tricks_with_strange_naming) cmd='inigrep -s "section with/ slash and spaces" -' ;;
80
         tricks_with_strange_naming) cmd='inigrep -s "section with/ slash and spaces" -' ;;
74
         strict_and_space)           cmd='inigrep -S -s myscript -k py -' ;;
81
         strict_and_space)           cmd='inigrep -S -s myscript -k py -' ;;
75
         strict_and_tab)             cmd='inigrep -S -s my_script -k py -' ;;
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
         list_keys)                  cmd='inigrep -L keys -' ;;
87
         list_keys)                  cmd='inigrep -L keys -' ;;
77
         list_paths)                 cmd='inigrep -l -' ;;
88
         list_paths)                 cmd='inigrep -l -' ;;
78
         list_sections)              cmd='inigrep -L sections -' ;;
89
         list_sections)              cmd='inigrep -L sections -' ;;

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_hash.stdout Ver arquivo

1
+0

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_hash_and_strict.stdout Ver arquivo

1
+ I'm a C# developer    # but is a proud programmer

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_sc.stdout Ver arquivo

1
+1024

+ 1
- 0
tests/inigrep_inigrep/oracle/inlinecmt_sc_and_strict.stdout Ver arquivo

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

+ 9
- 0
tests/inigrep_inigrep/test/inlinecmt.stdin Ver arquivo

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!