File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
rust/src/nasl/builtin/sys Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -127,4 +127,25 @@ mod tests {
127
127
t. ok ( r#"pread("basename", "/a/b/c");"# , "c\n " ) ;
128
128
t. async_verify ( ) . await ;
129
129
}
130
+
131
+ #[ tokio:: test]
132
+ async fn find_in_path ( ) {
133
+ let mut t = TestBuilder :: default ( ) ;
134
+ t. ok ( r#"find_in_path("basename");"# , true ) ;
135
+ // Cannot think of a way to construct a command name here
136
+ // that is very unlikely to exist without it sounding ridiculous
137
+ t. ok ( r#"find_in_path("foobarbaz");"# , false ) ;
138
+ t. async_verify ( ) . await ;
139
+ }
140
+
141
+ #[ tokio:: test]
142
+ async fn write_read_to_tmpdir ( ) {
143
+ let mut t = TestBuilder :: default ( ) ;
144
+ t. run ( r#"path = get_tmp_dir();"# ) ;
145
+ t. run ( r#"file = path + "/write_read_to_tmpdir";"# ) ;
146
+ t. ok ( r#"fwrite(file: file, data: "foo");"# , 3 ) ;
147
+ t. ok ( r#"fread(file);"# , "foo" ) ;
148
+ t. ok ( r#"file_stat(file);"# , 3 ) ;
149
+ t. async_verify ( ) . await ;
150
+ }
130
151
}
You can’t perform that action at this time.
0 commit comments