Browse Source

use string_view in unittest_nfc. That avoids copying and makes compiler happy, too!

master
roker 4 years ago
parent
commit
6e1f680ec5
  1. 8
      test/unittest_nfc.cc

8
test/unittest_nfc.cc

@ -9,10 +9,10 @@ namespace {
struct TestEntry struct TestEntry
{ {
std::string input; string_view input;
bool is_nfc; bool is_nfc;
IsNFC quick; IsNFC quick;
std::string nfc; string_view nfc;
}; };
typedef TestEntry TE; typedef TestEntry TE;
@ -46,8 +46,8 @@ const std::vector<TestEntry> testValues =
{ "a\xcc\x85\xcc\xbc", false, IsNFC::No , "a\xcc\xbc\xcc\x85"}, // a + <U+0305> + <U+033C> (overline + seagull_below) { "a\xcc\x85\xcc\xbc", false, IsNFC::No , "a\xcc\xbc\xcc\x85"}, // a + <U+0305> + <U+033C> (overline + seagull_below)
{ "a\xcc\xbc\xcc\x85", true, IsNFC::Yes , "a\xcc\xbc\xcc\x85"}, // a + <U+033C> + <U+0305> (seagull_below + overline) { "a\xcc\xbc\xcc\x85", true, IsNFC::Yes , "a\xcc\xbc\xcc\x85"}, // a + <U+033C> + <U+0305> (seagull_below + overline)
{ std::string(nullo, nullo+1), true, IsNFC::Yes, std::string(nullo, nullo+1) }, // Yeah, 1 NUL byte { string_view(nullo, 1), true, IsNFC::Yes, string_view(nullo, 1) }, // Yeah, 1 NUL byte
{ std::string(nullo, nullo+4), true, IsNFC::Yes, std::string(nullo, nullo+4) }, // Yeah, 4 NUL bytes { string_view(nullo, 4), true, IsNFC::Yes, string_view(nullo, 4) }, // Yeah, 4 NUL bytes
{ "EOF", true, IsNFC::Yes, "EOF" } { "EOF", true, IsNFC::Yes, "EOF" }
}; };

Loading…
Cancel
Save