changed tests to quit when they fail
[strong_simulation_stabilizer_rank.git] / test2.bash
index 281422b6fec9ef69fab18fc533e0f798661403c5..e6b3122464520df26dd6603db7924aba99a7efc6 100644 (file)
@@ -31,12 +31,18 @@ bre=$(echo "$b" | cut -f 1 -d " " | cut -c 1-5);
 bim=$(echo "$b" | cut -f 3 -d " " | cut -c 1-5); echo "$i: $are $aimsign $aim and $bre $bimsign $bim"
 rediff=$( printf 'sqrt((%f - %f)^2)\n' "$are" "$bre" | bc -l )
 imdiff=$( printf 'sqrt((%f - %f)^2)\n' "$aim" "$bim" | bc -l )
-if (( $(echo "$rediff < $threshold" |bc -l) )) && (( $(echo "$imdiff < $threshold" |bc -l) )) && [ "$aimsign" == "$bimsign" ]
+if (( $(echo "$rediff < $threshold" |bc -l) )) && (( $(echo "$imdiff < $threshold" |bc -l) ))
 then
-    continue
+    if  (( $(echo "$bim < $threshold" |bc -l) )) || [ "$aimsign" == "$bimsign" ]
+    then
+       continue
+    else
+       echo "NOTE EQUAL!"
+       exit
+    fi
   else
     echo "NOT EQUAL!"
-    break
+    exit
 fi
 done
 echo "Test passed!"