File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,8 @@ impl Function for Path {
39
39
path. push ( s. to_owned ( ) + std:: path:: MAIN_SEPARATOR . to_string ( ) . as_str ( ) ) ;
40
40
first = false ;
41
41
continue ;
42
- } else {
43
- path. push ( s) ;
44
42
}
43
+ path. push ( s) ;
45
44
} else {
46
45
return Err ( DscError :: Parser ( "Arguments must all be strings" . to_string ( ) ) ) ;
47
46
}
@@ -72,6 +71,14 @@ mod tests {
72
71
assert_eq ! ( result, format!( "a{separator}C:{separator}test" ) ) ;
73
72
}
74
73
74
+ #[ test]
75
+ fn unix_absolute_path ( ) {
76
+ let mut parser = Statement :: new ( ) . unwrap ( ) ;
77
+ let separator = std:: path:: MAIN_SEPARATOR ;
78
+ let result = parser. parse_and_execute ( "[path('/','a','b')]" , & Context :: new ( ) ) . unwrap ( ) ;
79
+ assert_eq ! ( result, format!( "/a{separator}b" ) ) ;
80
+ }
81
+
75
82
#[ test]
76
83
fn two_args ( ) {
77
84
let mut parser = Statement :: new ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments