ソースを参照

Add test for negative result

DricomDragon 5 年 前
コミット
2ee27defcd
1 ファイル変更5 行追加0 行削除
  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" ]