Skip to content

Commit

Permalink
Add test for #135 (RUST_SCRIPT_BASE_PATH with --base-path)
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Sep 3, 2024
1 parent e99dca3 commit da33453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/scripts/base-path-tmp.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tmp
9 changes: 9 additions & 0 deletions tests/scripts/base-path-tmp.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

WITHOUT_BASE_PATH=$(rust-script -e 'println!("{}", std::env::var("RUST_SCRIPT_BASE_PATH").unwrap());')
PWD=$(pwd)
if [ "$WITHOUT_BASE_PATH" != "$PWD" ]; then
echo "Error: Expected $PWD, was $WITHOUT_BASE_PATH"
fi

rust-script --base-path /tmp -e 'println!("{}", std::env::var("RUST_SCRIPT_BASE_PATH").unwrap());'

0 comments on commit da33453

Please sign in to comment.