Parcourir la source

Add mixed operation with + - * /

DricomDragon il y a 5 ans
Parent
commit
62ba9a55bf
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      test.bats

+ 5 - 0
test.bats

@@ -66,3 +66,8 @@
 	[ "$result" = "4" ]
 }
 
+@test "Mixed operation with * + / -" {
+	result="$(echo '15 * (1 + 1 + 1 + 4 - 2*2) / 3 / 15 =' | ./eval.out)"
+	[ "$result" = "1" ]
+}
+