diff options
| author | Rye <rye@alchemyviewer.org> | 2025-12-01 05:48:07 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-01 12:48:07 +0200 |
| commit | 416ab835aa4ba8e13d17e8b8ecb434aead3045de (patch) | |
| tree | 838487fd2f56412652996bf511598d1e8812846b /indra/llcommon/tests/llstring_test.cpp | |
| parent | fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1 (diff) | |
#5078 Replace boost::assign usage with modern c++ brace initialization
Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/llcommon/tests/llstring_test.cpp')
| -rw-r--r-- | indra/llcommon/tests/llstring_test.cpp | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index b18712b8e9..7393e0087c 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -28,13 +28,10 @@ #include "linden_common.h" -#include <boost/assign/list_of.hpp> #include "../llstring.h" #include "StringVec.h" // must come BEFORE lltut.h #include "../test/lltut.h" -using boost::assign::list_of; - namespace tut { struct string_index @@ -763,14 +760,14 @@ namespace tut ensure_equals("only delims", LLStringUtil::getTokens(" \r\n ", " \r\n"), StringVec()); ensure_equals("sequence of delims", - LLStringUtil::getTokens(",,, one ,,,", ","), list_of("one")); + LLStringUtil::getTokens(",,, one ,,,", ","), StringVec{"one"}); // nat considers this a dubious implementation side effect, but I'd // hate to change it now... ensure_equals("noncontiguous tokens", - LLStringUtil::getTokens(", ,, , one ,,,", ","), list_of("")("")("one")); + LLStringUtil::getTokens(", ,, , one ,,,", ","), StringVec{ "", "", "one" }); ensure_equals("space-padded tokens", - LLStringUtil::getTokens(", one , two ,", ","), list_of("one")("two")); - ensure_equals("no delims", LLStringUtil::getTokens("one", ","), list_of("one")); + LLStringUtil::getTokens(", one , two ,", ","), StringVec{"one", "two"}); + ensure_equals("no delims", LLStringUtil::getTokens("one", ","), StringVec{ "one" }); } // Shorthand for verifying that getTokens() behaves the same when you @@ -817,39 +814,33 @@ namespace tut ensure_getTokens("only delims", " \r\n ", " \r\n", "", StringVec()); ensure_getTokens("sequence of delims", - ",,, one ,,,", ", ", "", list_of("one")); + ",,, one ,,,", ", ", "", StringVec{"one"}); // Note contrast with the case in the previous method ensure_getTokens("noncontiguous tokens", - ", ,, , one ,,,", ", ", "", list_of("one")); + ", ,, , one ,,,", ", ", "", StringVec{"one"}); ensure_getTokens("space-padded tokens", ", one , two ,", ", ", "", - list_of("one")("two")); - ensure_getTokens("no delims", "one", ",", "", list_of("one")); + StringVec{"one", "two"}); + ensure_getTokens("no delims", "one", ",", "", StringVec{ "one" }); // drop_delims vs. keep_delims ensure_getTokens("arithmetic", - " ab+def / xx* yy ", " ", "+-*/", - list_of("ab")("+")("def")("/")("xx")("*")("yy")); + " ab+def / xx* yy ", " ", "+-*/", { "ab", "+", "def", "/", "xx", "*", "yy" }); // quotes ensure_getTokens("no quotes", - "She said, \"Don't go.\"", " ", ",", "", - list_of("She")("said")(",")("\"Don't")("go.\"")); + "She said, \"Don't go.\"", " ", ",", "", { "She", "said", ",", "\"Don't", "go.\"" }); ensure_getTokens("quotes", - "She said, \"Don't go.\"", " ", ",", "\"", - list_of("She")("said")(",")("Don't go.")); + "She said, \"Don't go.\"", " ", ",", "\"", { "She", "said", ",", "Don't go." }); ensure_getTokens("quotes and delims", "run c:/'Documents and Settings'/someone", " ", "", "'", - list_of("run")("c:/Documents and Settings/someone")); + { "run", "c:/Documents and Settings/someone" }); ensure_getTokens("unmatched quote", - "baby don't leave", " ", "", "'", - list_of("baby")("don't")("leave")); + "baby don't leave", " ", "", "'", { "baby", "don't", "leave" }); ensure_getTokens("adjacent quoted", - "abc'def \"ghi'\"jkl' mno\"pqr", " ", "", "\"'", - list_of("abcdef \"ghijkl' mnopqr")); + "abc'def \"ghi'\"jkl' mno\"pqr", " ", "", "\"'", { "abcdef \"ghijkl' mnopqr" }); ensure_getTokens("quoted empty string", - "--set SomeVar ''", " ", "", "'", - list_of("--set")("SomeVar")("")); + "--set SomeVar ''", " ", "", "'", { "--set", "SomeVar", "" }); // escapes // Don't use backslash as an escape for these tests -- you'll go nuts @@ -857,15 +848,12 @@ namespace tut // something else! ensure_equals("escaped delims", LLStringUtil::getTokens("^ a - dog^-gone^ phrase", " ", "-", "", "^"), - list_of(" a")("-")("dog-gone phrase")); + StringVec{ " a", "-", "dog-gone phrase" }); ensure_equals("escaped quotes", LLStringUtil::getTokens("say: 'this isn^'t w^orking'.", " ", "", "'", "^"), - list_of("say:")("this isn't working.")); + StringVec{ "say:", "this isn't working." }); ensure_equals("escaped escape", - LLStringUtil::getTokens("want x^^2", " ", "", "", "^"), - list_of("want")("x^2")); - ensure_equals("escape at end", - LLStringUtil::getTokens("it's^ up there^", " ", "", "'", "^"), - list_of("it's up")("there^")); + LLStringUtil::getTokens("want x^^2", " ", "", "", "^"), StringVec{ "want", "x^2" }); + ensure_equals("escape at end", LLStringUtil::getTokens("it's^ up there^", " ", "", "'", "^"), StringVec{ "it's up", "there^" }); } } |
