summaryrefslogtreecommitdiff
path: root/test/regress/BF3C1F82-2.test
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2013-01-17 12:18:58 +0100
committerJohann Klähn <kljohann@gmail.com>2013-01-17 12:19:23 +0100
commit3fe2ef59566ef679d9de58e5f9454b7443d9153a (patch)
tree3690c573e3c02dad77874a3e76c32344f5eb0be6 /test/regress/BF3C1F82-2.test
parentea249423d4ba00236c456080fade92f49d0622af (diff)
downloadfork-ledger-3fe2ef59566ef679d9de58e5f9454b7443d9153a.tar.gz
fork-ledger-3fe2ef59566ef679d9de58e5f9454b7443d9153a.tar.bz2
fork-ledger-3fe2ef59566ef679d9de58e5f9454b7443d9153a.zip
change handling of standard input
For `-f /dev/stdin`, the `pathname` of the parsing context will be empty as for any other streamed input. `instance_t::include_directive` did not work as expected for `-f /dev/stdin` and relative file names. One would expect them to be relative to the current directory rather than `/dev`. This will lead to `While parsing file ""` messages. This could be adjusted to read `While parsing standard input`, but maybe it's not worth the special cases. This commit also fixes bug 788: behaviour of source_context for '-f -'
Diffstat (limited to 'test/regress/BF3C1F82-2.test')
-rw-r--r--test/regress/BF3C1F82-2.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/regress/BF3C1F82-2.test b/test/regress/BF3C1F82-2.test
new file mode 100644
index 00000000..453151ce
--- /dev/null
+++ b/test/regress/BF3C1F82-2.test
@@ -0,0 +1,12 @@
+; Check that include directives are relative for "-f /dev/stdin"
+include non-existent-ledger-file-BF3C1F82
+test -f - reg -> 1
+__ERROR__
+While parsing file "", line 2:
+Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"
+end test
+test -f /dev/stdin reg -> 1
+__ERROR__
+While parsing file "", line 2:
+Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"
+end test