;dev:add.test: uniquify temp files, fixing intermittent results [#2356]

This commit is contained in:
Simon Michael 2025-06-01 12:28:50 -10:00
parent fe451208fe
commit 631e1e4265

View File

@ -1,4 +1,5 @@
# * add command # * add command
# Note the use of $$ to uniquify temp files, needed since tests run concurrently.
############################################################################## ##############################################################################
# data validation # data validation
# #
@ -110,7 +111,7 @@ a
b b
0.5 0.5
c c
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /Amount 3 \[-0.75\]:/ > /Amount 3 \[-0.75\]:/
>2 // >2 //
@ -124,7 +125,7 @@ a
b b
-50 USD == 50 USD -50 USD == 50 USD
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> // > //
>2 /Balance assertion failed in b/ >2 /Balance assertion failed in b/
@ -142,7 +143,7 @@ a
a a
-10 USD = 0 USD -10 USD = 0 USD
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /Save this transaction to the journal/ > /Save this transaction to the journal/
>2 // >2 //
@ -158,7 +159,7 @@ a
c c
-500 JPY -500 JPY
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /Save this transaction to the journal/ > /Save this transaction to the journal/
>2 // >2 //
@ -182,7 +183,7 @@ c
. .
# Check the output with c to make sure we get to the final transaction display # Check the output with c to make sure we get to the final transaction display
# (anything generic is also in the first transaction) # (anything generic is also in the first transaction)
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /c[[:space:]]+-10 USD/ > /c[[:space:]]+-10 USD/
>2 // >2 //
@ -199,7 +200,7 @@ a
a a
-500 MXN =* 0 MXN -500 MXN =* 0 MXN
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /Save this transaction to the journal/ > /Save this transaction to the journal/
>2 // >2 //
@ -216,7 +217,7 @@ x2
(a) (a)
3 = 3 ; date:2025-05-01 3 = 3 ; date:2025-05-01
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /\(a\)[[:space:]]+3 = 3 ; date:2025-05-01/ > /\(a\)[[:space:]]+3 = 3 ; date:2025-05-01/
>2 // >2 //
@ -229,7 +230,7 @@ a
b b
-10 USD -10 USD
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal -I add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal -I add; rm -f nosuch.$$.journal
> /Save this transaction to the journal/ > /Save this transaction to the journal/
>2 // >2 //
@ -242,7 +243,7 @@ a
b b
-10 USD -10 USD
. .
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> /Save this transaction to the journal/ > /Save this transaction to the journal/
>2 // >2 //
@ -260,7 +261,7 @@ y
x x
a a
10 USD 10 USD
$ rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal $ rm -f nosuch.$$.journal; hledger -f nosuch.$$.journal add; rm -f nosuch.$$.journal
> // > //
>2 /Balance assertion failed in a/ >2 /Balance assertion failed in a/