about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-02-12 14:39:40 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-02-12 15:49:39 +0100
commit109260f8f0d97d6f1aacefdee806103eac5144eb (patch)
tree0fab57b02367086054a85b0d617a3f0c1ff5ed49
parentc8e567ddc82bed8aac617741b799d24184358fcd (diff)
downloadrust-109260f8f0d97d6f1aacefdee806103eac5144eb.tar.gz
rust-109260f8f0d97d6f1aacefdee806103eac5144eb.zip
Add test to check if minified theme are handled correctly
-rw-r--r--src/librustdoc/theme/tests.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/librustdoc/theme/tests.rs b/src/librustdoc/theme/tests.rs
index 9ead1d28007..b924215733d 100644
--- a/src/librustdoc/theme/tests.rs
+++ b/src/librustdoc/theme/tests.rs
@@ -102,3 +102,16 @@ fn check_invalid_css() {
     let events = load_css_events(b"*");
     assert_eq!(events.len(), 0);
 }
+
+#[test]
+fn test_with_minification() {
+    let text = include_str!("../html/static/themes/dark.css");
+    let minified = minifier::css::minify(&text).expect("CSS minification failed");
+
+    let against = load_css_paths(text.as_bytes());
+    let other = load_css_paths(minified.as_bytes());
+
+    let mut ret = Vec::new();
+    get_differences(&against, &other, &mut ret);
+    assert!(ret.is_empty());
+}