Paul Smith fdcaaed8d7 * tests/scripts/*: Switch TAB chars to #TAB# markup
Avoid Emacs local variable settings to disable whitespace cleanup,
by creating markup tokens for TAB characters (#TAB#) and space
characters (#SPACE#) (for end-of-line spaces).  Modify all the
tests that use TABs to use the new markup.  This requires changing
some old-fashioned tests to use the modern run_make_test().  Also
remove some of the comments regarding test numbers now that the
framework keeps track.
2025-08-24 14:29:11 -04:00

51 lines
1.4 KiB
Perl

# -*-perl-*-
$description = "Test the and & or functions.\n";
$details = "Try various uses of and & or to ensure they all give the correct
results.\n";
# TEST #0
# For $(and ...), it will either be empty or the last value
run_make_test('
NEQ = $(subst $1,,$2)
f =
t = true
all:
#TAB#@echo 1 $(and ,$t)
#TAB#@echo 2 $(and $t)
#TAB#@echo 3 $(and $t,)
#TAB#@echo 4 $(and z,true,$f,false)
#TAB#@echo 5 $(and $t,$f,$(info bad short-circuit))
#TAB#@echo 6 $(and $(call NEQ,a,b),true)
#TAB#@echo 7 $(and $(call NEQ,a,a),true)
#TAB#@echo 8 $(and z,true,fal,se) hi
#TAB#@echo 9 $(and ,true,fal,se)there
#TAB#@echo 10 $(and $(e) ,$t)',
'',
"1\n2 true\n3\n4\n5\n6 true\n7\n8 se hi\n9 there\n10\n");
# TEST #1
# For $(or ...), it will either be empty or the first true value
run_make_test('
NEQ = $(subst $1,,$2)
f =
t = true
all:
#TAB#@echo 1 $(or , )
#TAB#@echo 2 $(or $t)
#TAB#@echo 3 $(or ,$t)
#TAB#@echo 4 $(or z,true,$f,false)
#TAB#@echo 5 $(or $t,$(info bad short-circuit))
#TAB#@echo 6 $(or $(info short-circuit),$t)
#TAB#@echo 7 $(or $(call NEQ,a,b),true)
#TAB#@echo 8 $(or $(call NEQ,a,a),true)
#TAB#@echo 9 $(or z,true,fal,se) hi
#TAB#@echo 10 $(or ,true,fal,se)there
#TAB#@echo 11 $(or $(e) ,$f)',
'',
"short-circuit\n1\n2 true\n3 true\n4 z\n5 true\n6 true\n7 b\n8 true\n9 z hi\n10 truethere\n11\n");
1;