diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-29 11:56:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-01-29 11:56:01 +0000 |
commit | dc74baf9e938243962617313464e3a24805fcb2c (patch) | |
tree | 213d332d893bd1c9289a3c577aa7140bdeb8b54e /test | |
parent | 67857e64c268fe2dc04e425c74e37c4859edfd58 (diff) | |
download | rspamd-dc74baf9e938243962617313464e3a24805fcb2c.tar.gz rspamd-dc74baf9e938243962617313464e3a24805fcb2c.zip |
[Project] Css: Several fixes + tests
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/unit/css.lua | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/test/lua/unit/css.lua b/test/lua/unit/css.lua index ad7d2762c..e040a6fd3 100644 --- a/test/lua/unit/css.lua +++ b/test/lua/unit/css.lua @@ -30,13 +30,80 @@ p { color: red; text-align: center; } +]], +[[ +.center { + text-align: center; + color: red; +}]], +[[ +/* This is a single-line comment */ +/* This is +a multi-line +comment */ + +p { + color: red; +} +]], +[[ +p:first-child { + color: blue; +} +a[target=_blank] { + background-color: yellow; +} +* { + box-sizing: border-box; +} + +body { + margin: 0; +} + +/* Style the header */ +.header { + background-color: #f1f1f1; + padding: 20px; + text-align: center; +} + +/* Style the top navigation bar */ +.topnav { + overflow: hidden; + background-color: #333; +} + +/* Style the topnav links */ +.topnav a { + float: left; + display: block; + color: #f2f2f2; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +/* Clear floats after the columns */ +.row:after { + content: ""; + display: table; + clear: both; +} + +/* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ +@media screen and (max-width: 600px) { + .column.side, .column.middle { + width: 100%; + } +} ]] } local NULL = ffi.new 'void*' for i,t in ipairs(cases) do test("Parse css sample " .. i, function() local escaped = ffi.C.rspamd_css_parse_style(pool:topointer(), t, #t, NULL) - assert_not_null(escaped) + --assert_not_nil(escaped) end) end end)
\ No newline at end of file |