From e66267faa68359dc70f4c2a57123ec3553f1ea2a Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 31 May 2012 15:56:54 -0300 Subject: [PATCH] b2/test/hierrul: field rules in hierarchy --- b2/test/hierrul | 270 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100755 b2/test/hierrul 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