1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-14 05:43:10 +02:00
eda-tools/b2/test/inv
Werner Almesberger d1593b6681 b2/: insert a virtual empty hierarchy if test input starts with other file
Also updated the regression tests that explicitly provided an empty
hierarchy.
2012-06-02 20:42:49 -03:00

80 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
. ./Common
###############################################################################
tst "inventory: one item" <<EOF
!-x
USD
!-i
FOO R101X CT 1234 1 USD 0 1 0.1 10 0.8 100 6
EOF
# provider name categ stock units/pkg curr add qty price ...
expect <<EOF
FOO R101X
FOO CT 1234 1 USD 0 1 0.1 10 0.8 100 6
EOF
#------------------------------------------------------------------------------
tst "inventory: two items" <<EOF
!-x
USD
!-i
FOO R101X CT 1234 1 USD 0 1 0.1 10 0.8 100 6
FOO R101X-T TR 1234 3000 USD 0 3000 13
EOF
expect <<EOF
FOO R101X-T
FOO TR 1234 3000 USD 0 3000 13
FOO R101X
FOO CT 1234 1 USD 0 1 0.1 10 0.8 100 6
EOF
#------------------------------------------------------------------------------
tst "inventory: two files" <<EOF
!-x
USD
!-i1
FOO R101X CT 1234 1 USD 0 1 0.1 10 0.8 100 6
!-i2
FOO R101X-T TR 1234 3000 USD 0 3000 13
EOF
expect <<EOF
FOO R101X
FOO CT 1234 1 USD 0 1 0.1 10 0.8 100 6
FOO R101X-T
FOO TR 1234 3000 USD 0 3000 13
EOF
#------------------------------------------------------------------------------
tst_fail "inventory: duplicate item" <<EOF
!-x
USD
!-i
FOO R101X CT 1234 1 USD 0 1 0.1 10 0.8 100 6
FOO R101X CT 1234 1 USD 0 1 0.1 10 0.8 100 6
EOF
expect <<EOF
i:3: part FOO R101X already has stock
EOF
#------------------------------------------------------------------------------
tst_fail "inventory: unknown currency" <<EOF
!-i
FOO R101X-T TR 1234 3000 EUR 0 3000 10.4
EOF
expect <<EOF
i:2: unknown currency EUR
EOF
###############################################################################