Browse Source

Add test for negative result

DricomDragon 5 years ago
parent
commit
2ee27defcd
1 changed files with 5 additions and 0 deletions
  1. 5 0
      test.bats

+ 5 - 0
test.bats

@@ -40,6 +40,11 @@
 	[ "$result" = "0" ]
 }
 
+@test "Negative result" {
+	result="$(echo '6 - 14=' | ./eval.out)"
+	[ "$result" = "-8" ]
+}
+
 @test "Basic division" {
 	result="$(echo '42 / 7 =' | ./eval.out)"
 	[ "$result" = "6" ]