diff --git a/tests/unit_tests.rs b/tests/unit_tests.rs index b96df90..3bc9853 100644 --- a/tests/unit_tests.rs +++ b/tests/unit_tests.rs @@ -43,6 +43,11 @@ fn complex_selectors() {
  • 2
  • 3
  • +
    + non link + link + non link +
    " @@ -61,4 +66,13 @@ fn complex_selectors() { assert_eq!(node.attr("class").unwrap(), "item"); assert!(node.attr("id").unwrap().contains(&text)); } + + let div = sel.css_once::("div").unwrap(); + for node in div.css::("a").iter() { + if node.attr("href").unwrap() == "#" { + assert_eq!(node.content(), "non link"); + } else { + assert_eq!(node.content(), "link"); + } + } }