Skip to content

Commit

Permalink
DEMO: sanitize slashes before snapshotting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Aug 4, 2023
1 parent 765f6da commit 304ab0d
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 61 deletions.
2 changes: 2 additions & 0 deletions tests/gallery/oranda_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ impl OrandaResult {
}
}
for (rel_path, path) in &results {
// normalize path to unix slashes when emitting to snapshot
let rel_path = rel_path.as_str().replace('\\', "/");
Self::append_snapshot_file(out, &format!("{name}/{rel_path}"), Some(path))?;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/gal_akaikatana-public.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source: tests/gallery/oranda_impl.rs
expression: "&snapshots"
---
================ public/artifacts\index.html ================
================ public/artifacts/index.html ================
<!DOCTYPE html>
<html lang="en" id="oranda" class="axo">
<head>
Expand Down
6 changes: 3 additions & 3 deletions tests/snapshots/gal_axolotlsay-public.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source: tests/gallery/oranda_impl.rs
expression: "&snapshots"
---
================ public/artifacts\index.html ================
================ public/artifacts/index.html ================
<!DOCTYPE html>
<html lang="en" id="oranda" class="dark">
<head>
Expand Down Expand Up @@ -295,7 +295,7 @@ expression: "&snapshots"

</body>
</html>
================ public/changelog\index.html ================
================ public/changelog/index.html ================
<!DOCTYPE html>
<html lang="en" id="oranda" class="dark">
<head>
Expand Down Expand Up @@ -447,7 +447,7 @@ expression: "&snapshots"

</body>
</html>
================ public/changelog\v0.1.0\index.html ================
================ public/changelog/v0.1.0/index.html ================
<!DOCTYPE html>
<html lang="en" id="oranda" class="dark">
<head>
Expand Down
Loading

0 comments on commit 304ab0d

Please sign in to comment.