File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ WINRT_EXPORT namespace winrt
233233 }
234234 else
235235 {
236- return {};
236+ return { L" " , 0 };
237237 }
238238 }
239239
Original file line number Diff line number Diff line change @@ -13,4 +13,15 @@ TEST_CASE("hstring_empty")
1313 // Using wcslen to both validate that the strings are empty *and* that they are not null.
1414 REQUIRE (wcslen (s.c_str ()) == 0 );
1515 REQUIRE (wcslen (s.data ()) == 0 );
16+
17+ std::wstring_view v = s;
18+ REQUIRE (v.empty ());
19+ REQUIRE (v.size () == 0 );
20+ REQUIRE (v == L" " sv);
21+ REQUIRE (std::distance (v.begin (), v.end ()) == 0 );
22+
23+ // Using wcslen to both validate that the strings are empty *and* that they are not null.
24+ // This is not guaranteed for wstring_view, but is assumed by some code that creates a
25+ // wstring_view from an hstring.
26+ REQUIRE (wcslen (v.data ()) == 0 );
1627}
You can’t perform that action at this time.
0 commit comments