1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Reworked static append fields

This commit is contained in:
Brian Fiete 2025-01-24 06:14:46 -08:00
parent 9d8647cd84
commit ec34aa3d43
6 changed files with 147 additions and 85 deletions

View file

@ -83,6 +83,22 @@ namespace Tests
public int mC = 234;
}
static class ClassG
{
public static append String sFirst;
public static append String sSecond;
public static append String sThird;
static public StringView sValue => Self.sFirst;
static public void Set(StringView value)
{
Self.sThird.Set(value);
Self.sSecond.Set(value);
Self.sFirst.Set(value);
}
}
static void CheckData(Object obj, int lastAllocSize, uint8[] data)
{
int objSize = typeof(Object).InstanceSize;
@ -129,6 +145,11 @@ namespace Tests
Test.Assert(cf.mB.AllocSize == 1024);
Test.Assert(cf.mC == 234);
cf.mB.Append('!', 2048);
ClassG.Set("1234567890");
Test.Assert(ClassG.sFirst == "1234567890");
Test.Assert(ClassG.sSecond == "1234567890");
Test.Assert(ClassG.sThird == "1234567890");
}
#endif
}