mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-05 11:21:53 +02:00
80 lines
1.6 KiB
Plaintext
80 lines
1.6 KiB
Plaintext
|
#!/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
|
||
|
|
||
|
###############################################################################
|