parent
853ea994bb
commit
3f7eb1b2aa
@ -58,6 +58,7 @@ add_unit_test(components/bar)
|
|||||||
add_unit_test(components/parser)
|
add_unit_test(components/parser)
|
||||||
add_unit_test(components/config_parser)
|
add_unit_test(components/config_parser)
|
||||||
add_unit_test(drawtypes/label)
|
add_unit_test(drawtypes/label)
|
||||||
|
add_unit_test(drawtypes/iconset)
|
||||||
|
|
||||||
# Run make check to build and run all unit tests
|
# Run make check to build and run all unit tests
|
||||||
add_custom_target(check
|
add_custom_target(check
|
||||||
|
18
tests/unit_tests/drawtypes/iconset.cpp
Normal file
18
tests/unit_tests/drawtypes/iconset.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "drawtypes/iconset.hpp"
|
||||||
|
|
||||||
|
#include "common/test.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace polybar;
|
||||||
|
using namespace polybar::drawtypes;
|
||||||
|
|
||||||
|
TEST(IconSet, fuzzyMatchExactMatchFirst) {
|
||||||
|
iconset_t icons = make_shared<iconset>();
|
||||||
|
|
||||||
|
icons->add("1", make_shared<label>("1"));
|
||||||
|
icons->add("10", make_shared<label>("10"));
|
||||||
|
|
||||||
|
label_t ret = icons->get("10", "", true);
|
||||||
|
|
||||||
|
EXPECT_EQ("10", ret->get());
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user