MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / TEST

Function TEST

src/css/css_tests.cpp:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28} // namespace css
29
30TEST(Css, Style)
31{
32 Rule background("background");
33 Rule text("text");
34 Rule border("border");
35 Style style("style");
36
37 style[background] = Value("image.png");
38 style[text] = Value("hi");
39 style[border] = Value(12.0, "px");
40 EXPECT_EQ(Value("image.png"), style[background]);
41 EXPECT_EQ(Value("hi"), style[text]);
42 EXPECT_EQ(Value(12.0, "px"), style[border]);
43
44 style[border].setNumber(13.0);
45 EXPECT_EQ(Value(13.0, "px"), style[border]);
46
47 Style style2("style2", &style);
48 EXPECT_EQ(&style, style2.base());
49 EXPECT_EQ(Value(), style2[background]);
50 EXPECT_EQ(Value(), style2[text]);
51 EXPECT_EQ(Value(), style2[border]);
52}
53
54TEST(Css, QueryIsInSyncWithStyleSheet)
55{

Callers

nothing calls this directly

Calls 7

setNumberMethod · 0.80
baseMethod · 0.80
addRuleMethod · 0.80
addStyleMethod · 0.80
queryMethod · 0.80
compoundStyleMethod · 0.80
ValueClass · 0.70

Tested by

no test coverage detected