Skip to content

Commit 4785441

Browse files
committed
test(pluginlab): update tests using --dir tmp/filesystem
1 parent 87041d7 commit 4785441

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

crates/pluginlab/tests/e2e_test.rs

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ mod e2e_test {
214214
std::env::set_current_dir(&project_root).unwrap();
215215
let mut session = spawn(
216216
&format!(
217-
"{} --dir crates/pluginlab",
217+
"{} --dir tmp/filesystem",
218218
&build_command(&["plugin_ls.wasm"], "repl_logic_guest.wasm")
219219
),
220220
Some(TEST_TIMEOUT),
@@ -233,19 +233,27 @@ mod e2e_test {
233233
session.send_line("ls").expect("Failed to send command");
234234
session
235235
.exp_string(
236-
"D\tsrc\r\nD\ttests\r\nD\twit\r\nF\tCargo.toml\r\nF\tREADME.md\r\nF\tbuild.rs\r\n",
236+
"D\tdata\r\nD\tdocuments\r\nD\tlogs\r\nF\t.config\r\nF\t.hidden_file\r\nF\tREADME.md\r\n",
237237
)
238238
.expect("Didn't get listing of current directory");
239-
session.send_line("ls wit").expect("Failed to send command");
240239
session
241-
.exp_string("F\twit/host-api.wit\r\nF\twit/plugin-api.wit\r\nF\twit/shared.wit\r\n")
242-
.expect("Didn't get listing of wit directory");
240+
.send_line("ls documents")
241+
.expect("Failed to send command");
242+
session
243+
.exp_string("D\tdocuments/work\r\nF\tdocuments/README.md\r\nF\tdocuments/config.json\r\nF\tdocuments/notes.txt\r\n")
244+
.expect("Didn't get listing of documents directory");
245+
session
246+
.send_line("ls documents/work/projects")
247+
.expect("Failed to send command");
248+
session
249+
.exp_string("D\tdocuments/work/projects/alpha\r\nD\tdocuments/work/projects/beta\r\nF\tdocuments/work/projects/.gitkeep\r\n")
250+
.expect("Didn't get listing of projects directory");
243251
session
244-
.send_line("ls wit/host-api.wit")
252+
.send_line("ls data/sample.csv")
245253
.expect("Failed to send command");
246254
session
247-
.exp_string("F\twit/host-api.wit\r\n")
248-
.expect("Didn't get listing of host-api.wit");
255+
.exp_string("F\tdata/sample.csv\r\n")
256+
.expect("Didn't get listing for a single file");
249257
}
250258

251259
#[test]
@@ -255,7 +263,7 @@ mod e2e_test {
255263
std::env::set_current_dir(&project_root).unwrap();
256264
let mut session = spawn(
257265
&format!(
258-
"{} --dir crates/pluginlab",
266+
"{} --dir tmp/filesystem",
259267
&build_command(&["plugin_cat.wasm"], "repl_logic_guest.wasm")
260268
),
261269
Some(TEST_TIMEOUT),
@@ -272,17 +280,17 @@ mod e2e_test {
272280
.exp_string("repl(0)>")
273281
.expect("Didn't see REPL prompt");
274282
session
275-
.send_line("cat wit")
283+
.send_line("cat documents")
276284
.expect("Failed to send command");
277285
session
278-
.exp_string("cat: wit: Is a directory")
286+
.exp_string("cat: documents: Is a directory")
279287
.expect("Didn't get expected error output for trying to cat a directory");
280288
session
281-
.send_line("cat wit/host-api.wit")
289+
.send_line("cat documents/README.md")
282290
.expect("Failed to send command");
283291
session
284-
.exp_string("package repl:api;")
285-
.expect("Didn't get expected contents of host-api.wit");
292+
.exp_string("# Documents")
293+
.expect("Didn't get expected contents of README.md");
286294
}
287295

288296
#[test]

0 commit comments

Comments
 (0)