From 90020202f003164c24c3a4291e2b28b12ad9fff8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Mar 2021 10:36:27 +0530 Subject: [PATCH] More tests for CSS transformer --- src/calibre/srv/tests/fast_css_transform.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calibre/srv/tests/fast_css_transform.py b/src/calibre/srv/tests/fast_css_transform.py index 9d08554d8c..54c994d2a8 100644 --- a/src/calibre/srv/tests/fast_css_transform.py +++ b/src/calibre/srv/tests/fast_css_transform.py @@ -35,11 +35,11 @@ class TestTransform(SimpleTest): s('@im/* c */port "x.y";', '@import "X.Y";') s('@import url("narrow.css") supports(display: flex) handheld and (max-width: 400px);', '@import url("NARROW.CSS") supports(display: flex) handheld and (max-width: 400px);') - s('@import url( x.y);', '@import url("X.Y");') + s('@import url( x/*a*/.y);', '@import url("X.Y");') u('background: url( te st.gif ) 12; src: url(x)', 'background: url("TE ST.GIF") 12; src: url("X")') u('background: url(te/**/st.gif); xxx: url()', 'background: url("TEST.GIF"); xxx: url()') - u(r'background: uRl(t\)est.gif)', 'background: url("T)EST.GIF")') + u(r'background: uRl(t\)e/st.gif)', 'background: url("T)E/ST.GIF")') u('a:url( "( )" /**/ )', 'a:url("( )")') u('a:url( "(/*)" )', 'a:url( "(/*)" )', url_callback=lambda x: x) @@ -60,18 +60,18 @@ class TestTransform(SimpleTest): d('xxx:yyy', 'xxx:yyy') sheet = ''' -@import "loc.test"; +@import "b/loc.test"; @media screen { font: 16px calc(20vw - 30rem); .cls { color: red; font-size: 16px; - background: url("loc.test") + background: url("b/loc.test") } #moo.cat { - x: url("loc.test") + x: url("b/loc.test") } @zoo { @@ -82,4 +82,4 @@ class TestTransform(SimpleTest): } .why { font: 16px} ''' - s(sheet, sheet.replace('16px', '1rem').replace('loc.test', 'LOC.TEST')) + s(sheet, sheet.replace('16px', '1rem').replace('b/loc.test', 'B/LOC.TEST'))