Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for comparing numb...



details:   https://anonhg.NetBSD.org/src/rev/7f7db50242a5
branches:  trunk
changeset: 1016140:7f7db50242a5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 23:00:09 2020 +0000

description:
make(1): add test for comparing numbers with strings

diffstat:

 usr.bin/make/unit-tests/cond-cmp-string.mk |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 83187fcb9202 -r 7f7db50242a5 usr.bin/make/unit-tests/cond-cmp-string.mk
--- a/usr.bin/make/unit-tests/cond-cmp-string.mk        Sun Nov 08 22:56:16 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.mk        Sun Nov 08 23:00:09 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.11 2020/10/30 14:53:31 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.12 2020/11/08 23:00:09 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -88,3 +88,16 @@
 .if ${:U word } != " ${:Uword} "
 .  error
 .endif
+
+# If at least one side of the comparison is a string literal, the string
+# comparison is performed.
+.if 12345 != "12345"
+.  error
+.endif
+
+# If at least one side of the comparison is a string literal, the string
+# comparison is performed.  The ".0" in the left-hand side makes the two
+# sides of the equation unequal.
+.if 12345.0 == "12345"
+.  error
+.endif



Home | Main Index | Thread Index | Old Index