From f07884c9f4bc0eececb150d3ee1a78d42cb20cbe Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 23 Mar 2024 02:56:56 -0600 Subject: Fix tests for github Fix the ~ test, so that it uses env!("HOME"), instead of my hard-coded home directory. --- src/poem.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3