Skip to content

Commit da33453

Browse files
committed
Add test for #135 (RUST_SCRIPT_BASE_PATH with --base-path)
1 parent e99dca3 commit da33453

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/scripts/base-path-tmp.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tmp

tests/scripts/base-path-tmp.script

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
WITHOUT_BASE_PATH=$(rust-script -e 'println!("{}", std::env::var("RUST_SCRIPT_BASE_PATH").unwrap());')
4+
PWD=$(pwd)
5+
if [ "$WITHOUT_BASE_PATH" != "$PWD" ]; then
6+
echo "Error: Expected $PWD, was $WITHOUT_BASE_PATH"
7+
fi
8+
9+
rust-script --base-path /tmp -e 'println!("{}", std::env::var("RUST_SCRIPT_BASE_PATH").unwrap());'

0 commit comments

Comments
 (0)