summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRory Dudley2024-03-23 02:56:56 -0600
committerRory Dudley2024-03-23 02:56:56 -0600
commitf07884c9f4bc0eececb150d3ee1a78d42cb20cbe (patch)
treeb4fd250f6279a6db4ec5c2fad90770c21d279d36
parent5a7718698373d07a29fffcb792acdb81aa7712d7 (diff)
downloaddwarvish-f07884c9f4bc0eececb150d3ee1a78d42cb20cbe.tar.gz
Fix tests for github
Fix the ~ test, so that it uses env!("HOME"), instead of my hard-coded home directory.
-rw-r--r--src/poem.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/poem.rs b/src/poem.rs
index c0e7d6b..db51d16 100644
--- a/src/poem.rs
+++ b/src/poem.rs
@@ -270,14 +270,14 @@ mod tests {
let poetry = "cd ~".to_string();
let poem = Poem::read(poetry).unwrap();
assert_eq!(poem[0].verb(), "cd");
- assert_eq!(poem[0].clause(), Some(vec!["/home/rory".to_string()]));
+ assert_eq!(poem[0].clause(), Some(vec![env!("HOME").to_string()]));
let poetry = "cd ~/Code/dwarvish".to_string();
let poem = Poem::read(poetry).unwrap();
assert_eq!(poem[0].verb(), "cd");
assert_eq!(
poem[0].clause(),
- Some(vec!["/home/rory/Code/dwarvish".to_string()])
+ Some(vec![format!("{}/Code/dwarvish", env!("HOME")).to_string()])
);
assert_eq!(poem[0].meter, Rune::None);
}