summaryrefslogtreecommitdiff
path: root/unit-tests/cond-cmp-numeric-eq.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/cond-cmp-numeric-eq.mk')
-rwxr-xr-xunit-tests/cond-cmp-numeric-eq.mk33
1 files changed, 24 insertions, 9 deletions
diff --git a/unit-tests/cond-cmp-numeric-eq.mk b/unit-tests/cond-cmp-numeric-eq.mk
index 02b95ae593cbd..0e77d364ac944 100755
--- a/unit-tests/cond-cmp-numeric-eq.mk
+++ b/unit-tests/cond-cmp-numeric-eq.mk
@@ -1,43 +1,43 @@
-# $NetBSD: cond-cmp-numeric-eq.mk,v 1.1 2020/08/23 13:50:17 rillig Exp $
+# $NetBSD: cond-cmp-numeric-eq.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
#
# Tests for numeric comparisons with the == operator in .if conditions.
# This comparison yields the same result, whether numeric or character-based.
.if 1 == 1
.else
-.error
+. error
.endif
# This comparison yields the same result, whether numeric or character-based.
.if 1 == 2
-.error
+. error
.endif
.if 2 == 1
-.error
+. error
.endif
# Scientific notation is supported, as per strtod.
.if 2e7 == 2000e4
.else
-.error
+. error
.endif
.if 2000e4 == 2e7
.else
-.error
+. error
.endif
# Trailing zeroes after the decimal point are irrelevant for the numeric
# value.
.if 3.30000 == 3.3
.else
-.error
+. error
.endif
.if 3.3 == 3.30000
.else
-.error
+. error
.endif
# As of 2020-08-23, numeric comparison is implemented as parsing both sides
@@ -46,7 +46,22 @@
# be equal.
.if 1.000000000000000001 == 1.000000000000000002
.else
-.error
+. error
+.endif
+
+
+# There is no = operator for numbers.
+.if !(12345 = 12345)
+. error
+.else
+. error
+.endif
+
+# There is no === operator for numbers either.
+.if !(12345 === 12345)
+. error
+.else
+. error
.endif
all: