lib/tests: rework in terms of Mu::Message
This commit is contained in:
@ -149,12 +149,7 @@ Mu::utf8_clean(const std::string& dirty)
|
||||
g_string_append_unichar(gstr, uc);
|
||||
}
|
||||
|
||||
std::string clean(gstr->str, gstr->len);
|
||||
|
||||
clean.erase(0, clean.find_first_not_of(" "));
|
||||
clean.erase(clean.find_last_not_of(" ") + 1); // remove trailing space
|
||||
|
||||
return clean;
|
||||
return std::string{g_strstrip(gstr->str)};
|
||||
}
|
||||
|
||||
std::string
|
||||
|
||||
@ -450,6 +450,24 @@ private:
|
||||
} while(0)
|
||||
|
||||
|
||||
#define assert_equal_seq(seq1__, seq2__) do { \
|
||||
g_assert_cmpuint(seq1__.size(), ==, seq2__.size()); \
|
||||
size_t n__{}; \
|
||||
for (auto&& item__: seq1__) { \
|
||||
g_assert_true(item__ == seq2__.at(n__)); \
|
||||
++n__; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define assert_equal_seq_str(seq1__, seq2__) do { \
|
||||
g_assert_cmpuint(seq1__.size(), ==, seq2__.size()); \
|
||||
size_t n__{}; \
|
||||
for (auto&& item__: seq1__) { \
|
||||
assert_equal(item__, seq2__.at(n__)); \
|
||||
++n__; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* For unit-tests, allow warnings in the current function.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user