diff options
Diffstat (limited to 'test/style/style.cpp')
-rw-r--r-- | test/style/style.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/style/style.cpp b/test/style/style.cpp index b4211cb071..6fa6a64b18 100644 --- a/test/style/style.cpp +++ b/test/style/style.cpp @@ -38,13 +38,25 @@ TEST(Style, UnusedSourceActiveViaClassUpdate) { StubFileSource fileSource; Style style { data, fileSource }; - data.addClass("visible"); - style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json"), ""); + EXPECT_TRUE(style.addClass("visible")); + EXPECT_TRUE(style.hasClass("visible")); + style.cascade(); style.recalculate(0); Source *unusedSource = style.getSource("unusedsource"); EXPECT_TRUE(unusedSource); EXPECT_TRUE(unusedSource->isLoaded()); + + // Style classes should be cleared upon new style load. + style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json"), ""); + EXPECT_FALSE(style.hasClass("visible")); + + style.cascade(); + style.recalculate(0); + + unusedSource = style.getSource("unusedsource"); + EXPECT_TRUE(unusedSource); + EXPECT_FALSE(unusedSource->isLoaded()); } |