2012-06-01 20:52:32 +03:00
|
|
|
#!/bin/bash
|
|
|
|
. ./Common
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: == 1 followed by == 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
1: { X=* };
|
|
|
|
2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
N=## {
|
|
|
|
1: { X=* }
|
|
|
|
2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: == 2 followed by unreachable == 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
2: { X=* };
|
|
|
|
2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
h:4: warning: unreachable condition
|
|
|
|
N=## {
|
|
|
|
2: { X=* }
|
|
|
|
2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: < 2 followed by < 3" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<2: { X=* };
|
|
|
|
<3: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
N=## {
|
|
|
|
<2: { X=* }
|
|
|
|
<3: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: < 3 followed by unreachable < 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<3: { X=* };
|
|
|
|
<2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
h:4: warning: unreachable condition
|
|
|
|
N=## {
|
|
|
|
<3: { X=* }
|
|
|
|
<2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: < 2 followed by <= 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<2: { X=* };
|
|
|
|
<=2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
N=## {
|
|
|
|
<2: { X=* }
|
|
|
|
<=2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: <= 2 followed by unreachable < 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<=2: { X=* };
|
|
|
|
<2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
h:4: warning: unreachable condition
|
|
|
|
N=## {
|
|
|
|
<=2: { X=* }
|
|
|
|
<2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: < 3 followed by > 1" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<3: { X=* };
|
|
|
|
>1: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
N=## {
|
|
|
|
<3: { X=* }
|
|
|
|
>1: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2012-06-02 11:24:50 +03:00
|
|
|
tst "hierarchy: < 3 followed by predictable but reachable > 2" -dh <<EOF
|
2012-06-01 20:52:32 +03:00
|
|
|
N=## {
|
|
|
|
<3: { X=* };
|
|
|
|
>2: { Y=* };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
expect <<EOF
|
|
|
|
N=## {
|
|
|
|
<3: { X=* }
|
|
|
|
>2: { Y=* }
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
###############################################################################
|