Skip to content

Commit 8195405

Browse files
committed
fix tests
1 parent ab7d491 commit 8195405

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

dsc_lib/src/functions/path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ mod tests {
5050
use crate::parser::Statement;
5151

5252
#[test]
53-
fn no_arg() {
53+
fn two_args() {
5454
let mut parser = Statement::new().unwrap();
5555
let separator = std::path::MAIN_SEPARATOR;
56-
let result = parser.parse_and_execute("[path('a','b'", &Context::new()).unwrap();
56+
let result = parser.parse_and_execute("[path('a','b')]", &Context::new()).unwrap();
5757
assert_eq!(result, format!("a{separator}b"));
5858
}
5959

6060
#[test]
61-
fn with_arg() {
61+
fn three_args() {
6262
let mut parser = Statement::new().unwrap();
6363
let separator = std::path::MAIN_SEPARATOR;
6464
let result = parser.parse_and_execute("[path('a','b','c')]", &Context::new()).unwrap();
65-
assert_eq!(result, format!("{separator}a{separator}b{separator}c"));
65+
assert_eq!(result, format!("a{separator}b{separator}c"));
6666
}
6767
}

dsc_lib/src/functions/target_path.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ mod tests {
4343
#[test]
4444
fn init() {
4545
let mut parser = Statement::new().unwrap();
46-
let mut context = Context::new();
47-
let result = parser.parse_and_execute("[targetPath()]", &context).unwrap();
46+
let result = parser.parse_and_execute("[targetPath()]", &Context::new()).unwrap();
4847
assert_eq!(result, "");
4948
}
5049

0 commit comments

Comments
 (0)