diff --git a/src/main.rs b/src/main.rs index 98520eb..fe76508 100644 --- a/src/main.rs +++ b/src/main.rs @@ -661,6 +661,51 @@ async fn main() -> Result<()> { }) .await; + success &= Test::run("Unusual uploads", &harness, |test| async move { + let id = test + .step("upload demo with directory prefix", |client| async move { + Ok(client + .upload_demo( + String::from("demos/test.dem"), + granary_data.to_vec(), + String::from("RED"), + String::from("BLUE"), + String::from("token"), + ) + .await?) + }) + .await?; + + test.step("name is stripped", |client| async move { + let demo = client.get(id).await?; + assert_eq(demo.name, "test.dem") + }) + .await?; + + let id = test + .step("upload demo with percent", |client| async move { + Ok(client + .upload_demo( + String::from("test%foo.dem"), + process_data.to_vec(), + String::from("RED"), + String::from("BLUE"), + String::from("token"), + ) + .await?) + }) + .await?; + + test.step("name is normalized", |client| async move { + let demo = client.get(id).await?; + assert_eq(demo.name, "test_foo.dem") + }) + .await?; + + Ok(()) + }) + .await; + if !success { std::process::exit(1); }