Skip to content

Commit

Permalink
add test filter option
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleailes committed Jul 18, 2023
1 parent ea1031b commit d5458b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quiet-stroll"
version = "1.0.0-rc.2"
version = "1.0.0-rc.3"
edition = "2021"
authors = ["Philippe Llerena<[email protected]>"]
description = "A web server to deliver basic File System informations"
Expand Down
8 changes: 8 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn test_listdir() {
assert_eq!(response.status(), Status::Ok);
assert_eq!(response.into_string().unwrap().replace("\\\\", "/"),"{\"paths_list\":[\"./samples/aaa.001.tif\",\"./samples/aaa.002.tif\",\"./samples/aaa.003.tif\",\"./samples/aaa.004.tif\",\"./samples/aaa.005.tif\",\"./samples/bbb.001.exr\",\"./samples/subfolder\"]}");
}
#[test]
fn test_listdir_packed() {
let message = InputPath::new("./samples/".to_string());
let client = Client::tracked(rocket()).expect("valid rocket instance");
let response = client.post("/listdir?packed=true").json(&message).dispatch();
assert_eq!(response.status(), Status::Ok);
assert_eq!(response.into_string().unwrap().replace("\\\\", "/"),"{\"paths_list\":[\"./samples/aaa.***.tif@1-5\",\"./samples/bbb.***.exr@1\",\"./samples/subfolder\"]}");
}
/// Test the glob function
#[test]
fn test_glob() {
Expand Down

0 comments on commit d5458b0

Please sign in to comment.