From 99b32d2ba33b756a35f873732dea7f1b22684de1 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Fri, 6 Sep 2013 21:34:10 -0700 Subject: [PATCH] add tests for *-child pseudo selectors with classes --- test/css/test_nthiness.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/css/test_nthiness.rb b/test/css/test_nthiness.rb index c2a2457c831..b7594efb6ed 100644 --- a/test/css/test_nthiness.rb +++ b/test/css/test_nthiness.rb @@ -127,6 +127,13 @@ def test_last_child assert_result_rows [14], @parser.search("table/tr:last-child") assert_result_rows [3,4], @parser.search("div/h1.c:last-child"), "header" end + + def test_nth_child + assert_result_rows [2], @parser.search("div/b:nth-child(3)"), "bold" + assert_result_rows [5], @parser.search("table/tr:nth-child(5)") + assert_result_rows [1,3], @parser.search("div/h1.c:nth-child(2)"), "header" + assert_result_rows [3,4], @parser.search("div/i.b:nth-child(2n+1)"), "italic" + end def test_first_of_type assert_result_rows [1], @parser.search("table/tr:first-of-type")