mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add removeStringEnd()
This commit is contained in:
parent
26666bb36f
commit
e71262463f
2 changed files with 21 additions and 0 deletions
|
@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "mapsector.h"
|
||||
#include "settings.h"
|
||||
#include "log.h"
|
||||
#include "utility_string.h"
|
||||
|
||||
/*
|
||||
Asserts that the exception occurs
|
||||
|
@ -120,6 +121,11 @@ struct TestUtilities
|
|||
assert(is_yes("YeS") == true);
|
||||
assert(is_yes("") == false);
|
||||
assert(is_yes("FAlse") == false);
|
||||
const char *ends[] = {"abc", "c", "bc", NULL};
|
||||
assert(removeStringEnd("abc", ends) == "");
|
||||
assert(removeStringEnd("bc", ends) == "b");
|
||||
assert(removeStringEnd("12c", ends) == "12");
|
||||
assert(removeStringEnd("foo", ends) == "");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue