[librsvg] css: fmt
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] css: fmt
- Date: Sat, 11 Jan 2020 16:06:51 +0000 (UTC)
commit b61cbbbfa8ebd593b43dd7cdd28f7031cb535519
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Jan 11 16:50:27 2020 +0100
css: fmt
rsvg_internals/src/css.rs | 47 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 34 insertions(+), 13 deletions(-)
---
diff --git a/rsvg_internals/src/css.rs b/rsvg_internals/src/css.rs
index 3f0097bf..6d654dea 100644
--- a/rsvg_internals/src/css.rs
+++ b/rsvg_internals/src/css.rs
@@ -766,8 +766,8 @@ pub fn cascade(root: &mut RsvgNode, stylesheets: &[Stylesheet]) {
#[cfg(test)]
mod tests {
use super::*;
- use glib::{self, prelude::*};
use gio;
+ use glib::{self, prelude::*};
use selectors::Element;
use crate::allowed_url::Fragment;
@@ -781,8 +781,9 @@ mod tests {
Document::load_from_stream(
&LoadOptions::new(None),
&stream.upcast(),
- None::<&gio::Cancellable>
- ).unwrap()
+ None::<&gio::Cancellable>,
+ )
+ .unwrap()
}
#[test]
@@ -797,10 +798,18 @@ mod tests {
"#,
);
- let a = document.lookup(&Fragment::new(None, "a".to_string())).unwrap();
- let b = document.lookup(&Fragment::new(None, "b".to_string())).unwrap();
- let c = document.lookup(&Fragment::new(None, "c".to_string())).unwrap();
- let d = document.lookup(&Fragment::new(None, "d".to_string())).unwrap();
+ let a = document
+ .lookup(&Fragment::new(None, "a".to_string()))
+ .unwrap();
+ let b = document
+ .lookup(&Fragment::new(None, "b".to_string()))
+ .unwrap();
+ let c = document
+ .lookup(&Fragment::new(None, "c".to_string()))
+ .unwrap();
+ let d = document
+ .lookup(&Fragment::new(None, "d".to_string()))
+ .unwrap();
// Node types
@@ -839,12 +848,24 @@ mod tests {
assert!(b.is_same_type(&d));
assert!(a.has_id(&LocalName::from("a"), CaseSensitivity::AsciiCaseInsensitive));
- assert!(!b.has_id(&LocalName::from("foo"), CaseSensitivity::AsciiCaseInsensitive));
-
- assert!(d.has_class(&LocalName::from("foo"), CaseSensitivity::AsciiCaseInsensitive));
- assert!(d.has_class(&LocalName::from("bar"), CaseSensitivity::AsciiCaseInsensitive));
-
- assert!(!a.has_class(&LocalName::from("foo"), CaseSensitivity::AsciiCaseInsensitive));
+ assert!(!b.has_id(
+ &LocalName::from("foo"),
+ CaseSensitivity::AsciiCaseInsensitive
+ ));
+
+ assert!(d.has_class(
+ &LocalName::from("foo"),
+ CaseSensitivity::AsciiCaseInsensitive
+ ));
+ assert!(d.has_class(
+ &LocalName::from("bar"),
+ CaseSensitivity::AsciiCaseInsensitive
+ ));
+
+ assert!(!a.has_class(
+ &LocalName::from("foo"),
+ CaseSensitivity::AsciiCaseInsensitive
+ ));
assert!(d.is_empty());
assert!(!a.is_empty());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]