1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 09:30:18 +02:00
eda-tools/b2/test/inv

80 lines
1.6 KiB
Plaintext
Raw Normal View History

2012-06-02 20:32:41 +03:00
#!/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
###############################################################################