Skip to content

Commit

Permalink
add tests for *-child pseudo selectors with classes
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Sep 7, 2013
1 parent e0fbeb8 commit 99b32d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/css/test_nthiness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 99b32d2

Please sign in to comment.