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 hexadecimal nu...
details: https://anonhg.NetBSD.org/src/rev/c9c4c83de635
branches: trunk
changeset: 942494:c9c4c83de635
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 08 22:28:05 2020 +0000
description:
make(1): add test for hexadecimal numbers in conditionals
diffstat:
usr.bin/make/unit-tests/cond-token-number.exp | 2 +-
usr.bin/make/unit-tests/cond-token-number.mk | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diffs (44 lines):
diff -r 226597418823 -r c9c4c83de635 usr.bin/make/unit-tests/cond-token-number.exp
--- a/usr.bin/make/unit-tests/cond-token-number.exp Sun Nov 08 22:22:03 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-token-number.exp Sun Nov 08 22:28:05 2020 +0000
@@ -2,7 +2,7 @@
make: "cond-token-number.mk" line 21: Malformed conditional (+0)
make: "cond-token-number.mk" line 29: Malformed conditional (!-1)
make: "cond-token-number.mk" line 37: Malformed conditional (!+1)
-make: "cond-token-number.mk" line 54: End of the tests.
+make: "cond-token-number.mk" line 70: End of the tests.
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
diff -r 226597418823 -r c9c4c83de635 usr.bin/make/unit-tests/cond-token-number.mk
--- a/usr.bin/make/unit-tests/cond-token-number.mk Sun Nov 08 22:22:03 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-token-number.mk Sun Nov 08 22:28:05 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-token-number.mk,v 1.3 2020/09/14 06:22:59 rillig Exp $
+# $NetBSD: cond-token-number.mk,v 1.4 2020/11/08 22:28:05 rillig Exp $
#
# Tests for number tokens in .if conditions.
@@ -50,6 +50,22 @@
. error
.endif
+# Hexadecimal numbers are accepted.
+.if 0x0
+. error
+.endif
+.if 0x1
+.else
+. error
+.endif
+
+# This is not a hexadecimal number, even though it has an x.
+# It is interpreted as a string instead, effectively meaning defined(3x4).
+.if 3x4
+.else
+. error
+.endif
+
# Ensure that parsing continues until here.
.info End of the tests.
Home |
Main Index |
Thread Index |
Old Index