diff options
author | Mauro Bieg <mb21@users.noreply.github.com> | 2019-05-28 17:51:21 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-05-28 11:51:21 -0400 |
commit | 214da7217bfc86d0bbe7c0175d2e2e97a00313a5 (patch) | |
tree | d247e721e62bd8489adfc449dd7edf6644d24b61 /test | |
parent | 0be83f24a9c863a8c0311d55aa9680f9f7577808 (diff) | |
download | pandoc-214da7217bfc86d0bbe7c0175d2e2e97a00313a5.tar.gz |
Fix handling of `file:` URL scheme in `downloadOrRead` (#5522)
Move up the pattern match to be reachable, closes #5517.
Previously `file:/` URLs were handled wrongly and pandoc attempted
to make HTTP requests, which failed.
Diffstat (limited to 'test')
-rw-r--r-- | test/command/5517.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/command/5517.md b/test/command/5517.md new file mode 100644 index 000000000..e309d84a4 --- /dev/null +++ b/test/command/5517.md @@ -0,0 +1,26 @@ +Use epub output to trigger `downloadOrRead` in `Text.Pandoc.Class` +in order to test `file:` URL-scheme handling. + +There are no relative `file:` URLs, so we cannot +test with an actual file, since we don't know the +current working directory. Instead, we use `/dev/null` +as a file that certainly exists, redirect stderr +to stdout and check that there is no warning. + +``` +% pandoc -M title=test -f native -t epub -o /dev/null 2>&1 +[Para [Image ("",[],[]) [] ("file:/dev/null","")]] +^D +``` + +``` +% pandoc -M title=test -f native -t epub -o /dev/null 2>&1 +[Para [Image ("",[],[]) [] ("file:///dev/null","")]] +^D +``` + +``` +% pandoc -M title=test -f native -t epub -o /dev/null 2>&1 +[Para [Image ("",[],[]) [] ("file://localhost/dev/null","")]] +^D +``` |