浏览代码

Add test for unary minus operator

DricomDragon 5 年之前
父节点
当前提交
3a3788ea63
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      test.bats

+ 5 - 0
test.bats

@@ -45,6 +45,11 @@
 	[ "$result" = "-8" ]
 }
 
+@test "Minus unary operand" {
+	result="$(echo '-4=' | ./eval.out)"
+	[ "$result" = "-4" ]
+}
+
 @test "Basic division" {
 	result="$(echo '42 / 7 =' | ./eval.out)"
 	[ "$result" = "6" ]