mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 09:15:31 +02:00
52e58cccbe
Just a plain "h", "c", etc., will do nicely. Also updated the one test set we have so far.
83 lines
1.6 KiB
Bash
Executable File
83 lines
1.6 KiB
Bash
Executable File
#!/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 field" <<EOF
|
|
{ X=* };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
{ X=* }
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "hierarchy: name set field (correct name)" <<EOF
|
|
<abc> = A<B<C;
|
|
{ X=<abc> };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
{ X=<abc> }
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst_fail "hierarchy: name set field (incorrect name)" <<EOF
|
|
<abc> = A<B<C;
|
|
{ X=<def> };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
h:2: unknown name set "def"
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "hierarchy: absolute value field" <<EOF
|
|
{ X=#foo };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
{ X=#foo }
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst_fail "hierarchy: absolute value field (omit type name)" <<EOF
|
|
{ X=# };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
h:1: syntax error
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "hierarchy: relative value field (correct name)" <<EOF
|
|
{ X=#foo Y=%X };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
{ X=#foo Y=%foo }
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst_fail "hierarchy: relative value field (incorrect name)" <<EOF
|
|
{ X=#foo Y=%Z };
|
|
EOF
|
|
|
|
expect <<EOF
|
|
h:1: unknown field "Z"
|
|
EOF
|
|
|
|
###############################################################################
|