]> ocean-lang.org Git - ocean/commitdiff
oceani: handle some more untested code.
authorNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 10:07:54 +0000 (21:07 +1100)
committerNeilBrown <neil@brown.name>
Sat, 18 Dec 2021 10:07:54 +0000 (21:07 +1100)
The mark-untested filter was removing some annotations that are valid...

I'm not sure of this 'switch' syntax ... need to think about that one day.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani-tests.mdc
csrc/oceani.mdc
tools/mark-untested

index 45240a2b5d20d2c70080b59936cd7186c7e45644..4e9f4e388ea123f0c457c97830f6818df8db799f 100644 (file)
@@ -221,12 +221,11 @@ Test merging of variables from multiple cases
                print
 
                for i:=0; then i=i+1; while i < 5:
-                       switch i:
-                               case 0: num:="zero"
-                               case 1: num:="one"
-                               case 2: num:="two"
-                               case 3: num:="three"
-                               else    num:="many"
+                       switch { use i }
+                               case 0: num:="zero" ;
+                               case 1: num:="one" ;
+                               case 2 { num:="two" } case 3 { num:="three" }
+                               else  num:="many"
                        // re-declare a CondScope variable
                        num := i*i
                        print num,", ",
index ca59924a22b9365e94a47c7d014c21528684aff8..ad0d1b5c6905e8be8c7a7867f2c4c132e35367f3 100644 (file)
@@ -4576,7 +4576,7 @@ the common header for all reductions to use.
 
        ComplexStatements -> ComplexStatements ComplexStatement ${
                if ($2 == NULL) {
-                       $0 = $<1;
+                       $0 = $<1;       // NOTEST - impossible
                } else {
                        $0 = new(binode);
                        $0->op = Block;
@@ -4586,7 +4586,7 @@ the common header for all reductions to use.
        }$
        | ComplexStatement ${
                if ($1 == NULL) {
-                       $0 = NULL;
+                       $0 = NULL;      // NOTEST - impossible
                } else {
                        $0 = new(binode);
                        $0->op = Block;
@@ -5784,7 +5784,7 @@ is a bit more interesting at this level.
                $0 = declare_function(c, $<FN, $<Ar, $<Ty, NULL, $<Bl);
        }$
        | func FuncName ( OpenScope ArgsLine ) : ( ArgsLine ) Block Newlines ${
-               $0 = declare_function(c, $<FN, $<AL, NULL, $<AL2, $<Bl);
+               $0 = declare_function(c, $<FN, $<AL, NULL, $<AL2, $<Bl);        // UNTESTED
        }$
        | func FuncName IN OpenScope Args OUT OptNL return Type Newlines do Block Newlines ${
                $0 = declare_function(c, $<FN, $<Ar, $<Ty, NULL, $<Bl);
@@ -5796,7 +5796,7 @@ is a bit more interesting at this level.
                $0 = declare_function(c, $<FN, $<Ar, NULL, $<Ar2, $<Bl);
        }$
        | func FuncName NEWLINE OpenScope return IN Args OUT OptNL do Block Newlines ${
-               $0 = declare_function(c, $<FN, NULL, NULL, $<Ar, $<Bl);
+               $0 = declare_function(c, $<FN, NULL, NULL, $<Ar, $<Bl); // UNTESTED
        }$
 
 ###### print func decls
index 96aeb2c4ff41aa032b1b6b53876321c372902130..83b7b5f852f945d9bdd3c93719494d58aca31bb4 100755 (executable)
@@ -17,7 +17,7 @@ case $1 in
         if [ ! -f "$b" ]; then 
            continue
         fi
-        grep '#####:' "$i" | grep -vE '(NOTEST|UNTESTED|:      *##|}\$$|:$|:[  ]*(\||\$))' |
+        grep '#####:' "$i" | grep -vE '(NOTEST|UNTESTED|:      *##|}\$$|:$)' |
             awk -F: '{printf "%ds,$,   // UNTESTED,\n", $2}' |
             sed -i -e 's,[      ]*// UNTESTED$,,' -f - "$b"
          grep '[0-8]: *[1-9][0-9]*:.*// NOTEST$' "$i" |