diff --git a/b2/test/hierrul b/b2/test/hierrul new file mode 100755 index 0000000..5b9cd0e --- /dev/null +++ b/b2/test/hierrul @@ -0,0 +1,270 @@ +#!/bin/bash +. ./Common + +# +# Note: the hierarchy dump differs in some details from the input format. +# Its main purpose is to aid with debugging, not to produce a syntactically +# valid representation of the currently loaded hierarchy. +# + +############################################################################### + +tst "hierarchy: name rule" < = mouse { + mouse: { X=* }; + cat: { Y=* }; + dog: { Z=* }; +}; +EOF + +expect < { + mouse: { X=* } + cat: { Y=* } + dog: { Z=* } +} +EOF + +#------------------------------------------------------------------------------ + +tst_fail "hierarchy: name set rule (invalid value)" < = mouse { + mouse: { X=* }; + cat: { Y=* }; + boat: { Z=* }; +}; +EOF + +expect < = mouse { + mouse: { X=* }; + cat: { Y=* }; + cat: { Z=* }; +}; +EOF + +expect < { + mouse: { X=* } + cat: { Y=* } + cat: { Z=* } +} +EOF + +#------------------------------------------------------------------------------ + +tst "hierarchy: absolute value rule" < = mouse = mouse = mouse