Skip to content

Commit e79bd4a

Browse files
committed
Fix tests
1 parent 27dc437 commit e79bd4a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

far/interf.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ TEST_CASE("wide_chars")
19041904
std::initializer_list<std::pair<size_t, int>>
19051905
StringToVisual,
19061906
VisualToString;
1907+
bool VtRequired;
19071908
}
19081909
Tests[]
19091910
{
@@ -1931,11 +1932,13 @@ TEST_CASE("wide_chars")
19311932
L"𐀀"sv, // Surrogate, half width
19321933
{ { 0, +0 }, { 1, -1 }, { 2, -1 }, { 3, -1 }, { 4, -1 }, },
19331934
{ { 0, +0 }, { 1, +1 }, { 2, +1 }, { 3, +1 }, { 4, +1 }, },
1935+
true,
19341936
},
19351937
{
19361938
L"𐀀𐀀"sv, // Surrogate, half width
19371939
{ { 0, +0 }, { 1, -1 }, { 2, -1 }, { 3, -2 }, { 4, -2 }, },
19381940
{ { 0, +0 }, { 1, +1 }, { 2, +2 }, { 3, +2 }, { 4, +2 }, },
1941+
true,
19391942
},
19401943
{
19411944
L"𠲖"sv, // Surrogate, full width
@@ -1950,14 +1953,20 @@ TEST_CASE("wide_chars")
19501953
{
19511954
L"残酷な天使のように少年よ神話になれ"sv,
19521955
{ {17, +17}, },
1953-
{ {34, -17} } },
1956+
{ {34, -17} },
1957+
},
19541958

19551959
};
19561960

1961+
const auto IsVtActive = console.IsVtActive();
1962+
19571963
char_width::enable(1);
19581964

19591965
for (const auto& i: Tests)
19601966
{
1967+
if (i.VtRequired && !IsVtActive)
1968+
continue;
1969+
19611970
position_parser_state State[2];
19621971

19631972
for (const auto& [StringPos, VisualShift]: i.StringToVisual)

0 commit comments

Comments
 (0)