Skip to content

Commit

Permalink
implemented unit test for serializing function blocks with/without pa…
Browse files Browse the repository at this point in the history
…rameters or nesting
  • Loading branch information
andrei-pham committed Oct 4, 2022
1 parent a0538a2 commit 15dd09f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_tinycss2.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ def test_serialize_declarations():
assert serialize(rules) == source


def test_serialize_rules_with_functions():
source = '''
foo#bar.baz {
background: url();
color: rgb(0, 0, 0);
width: calc(calc());
height: calc(calc(calc()));
}
'''
rules = parse_rule_list(source)
assert serialize(rules) == source


def test_backslash_delim():
source = '\\\nfoo'
tokens = parse_component_value_list(source)
Expand Down

0 comments on commit 15dd09f

Please sign in to comment.