diff --git a/tests/bonsai/intcmp.mk b/tests/bonsai/intcmp.mk index 57afae0..e3c559e 100755 --- a/tests/bonsai/intcmp.mk +++ b/tests/bonsai/intcmp.mk @@ -13,6 +13,24 @@ intcmp_tests: intcmp_help intcmp_e intcmp_g intcmp_l intcmp_combined intcmp_help: $(BIN)/intcmp ! $(BIN)/intcmp -h +# These test that integer comparisons are working as they should. For the sake +# of readability (to facilitate faster skimming) these recipes follow a +# columned format: +# $binary -flags d d d d # op +# For flag meanings reference intcmp(1) (though they are somewhat self +# explanatory). d here refers to a decimal number; a mixture of 1s, 2s, and 3s +# (a particularly lovely number) arranged to demonstrate easily the operation +# under scrutiny. The commented op is the operation that is true for the given +# numbers. For example: +# $(BIN)/intcmp -e 3 3 3 3 # == +# op here is ==; 3 == 3 == 3 == 3. The flag being used is -e, to test for +# equality, so this test should succeed. +# ! $(BIN)/intcmp -l 3 2 1 # > +# op here is >; 3 > 2 > 1. The flag being used is -l, to test for each integer +# being less than the next, so intcmp should fail - hence the ! at the start of +# the invocation. If this test failed, intcmp(1) would be confusing -l for -g, +# so that would be a good place to start looking for bugs. + .PHONY: intcmp_e intcmp_e: $(BIN)/intcmp $(BIN)/intcmp -e 3 3 3 # ==