Skip to content

Commit c121e57

Browse files
ZexbeJoshua Nelson
authored and
Joshua Nelson
committed
Add some svg tests
1 parent c937110 commit c121e57

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/db/file.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ mod test {
389389
check_mime("{}", "hello.json","application/json");
390390
check_mime("hello world", "hello.txt","text/plain");
391391
check_mime("//! Simple module to ...", "file.rs", "text/rust");
392+
check_mime("<svg></svg>", "important.svg", "image/svg+xml");
392393
}
393394

394395
fn check_mime(content: &str, path: &str, expected_mime: &str) {

src/utils/copy.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ mod test {
6363
fs::write(doc.join("index.txt"), "spooky").unwrap();
6464
fs::write(doc.join("inner").join("index.html"), "<html>spooky</html>").unwrap();
6565
fs::write(doc.join("inner").join("index.txt"), "spooky").unwrap();
66+
fs::write(doc.join("inner").join("important.svg"), "<svg></svg>").unwrap();
6667

6768
// lets try to copy a src directory to tempdir
6869
copy_doc_dir(source.path().join("doc"), destination.path()).unwrap();
6970
assert!(destination.path().join("index.html").exists());
7071
assert!(!destination.path().join("index.txt").exists());
7172
assert!(destination.path().join("inner").join("index.html").exists());
7273
assert!(!destination.path().join("inner").join("index.txt").exists());
74+
assert!(!destination.path().join("inner").join("important.svg").exists());
7375
}
7476
}

0 commit comments

Comments
 (0)