From c27ee1640bd2b179773de6e477bd9cd7a317f295 Mon Sep 17 00:00:00 2001 From: kirbylife Date: Sat, 30 Jan 2021 21:20:00 -0600 Subject: [PATCH] add new test requesting inside a Selector node --- tests/unit_tests.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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"); + } + } }