Skip to content

Commit e2341c2

Browse files
committed
Fix Map and ToLower
1 parent f92249e commit e2341c2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NStack/strings/ustring.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,7 @@ static ustring Map (Func<uint, uint> mapping, ustring s, Action scanReset = null
18181818
var mapped = mapping (rune);
18191819
if (mapped == rune) {
18201820
nbytes++;
1821+
offset += size;
18211822
continue;
18221823
}
18231824
modified = true;

NStackTests/ustringTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ public class UstringTest {
2525
ustring kosme = ustring.Make (0xce, 0xba, 0xcf, 0x8c, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5);
2626
ustring kosmex = ustring.Make (0xce, 0xba, 0xcf, 0x8c, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x41);
2727

28+
[Test]
29+
public void ToLowerTest ()
30+
{
31+
var x = ustring.Make ("C-x");
32+
var res = x.ToLower ();
33+
}
34+
2835
[Test]
2936
public void IComparableTests ()
3037
{

0 commit comments

Comments
 (0)