1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Initial checkin

This commit is contained in:
Brian Fiete 2019-08-23 11:56:54 -07:00
parent c74712dad9
commit 078564ac9e
3242 changed files with 1616395 additions and 0 deletions

View file

@ -0,0 +1,49 @@
using System;
extension LibClassA
{
public int32 mC = GetVal(9, "TestsB.LibClassA.mC");
public this()
{
PrintF("TestB.LibClassA()\n");
mB += 10000;
}
public int GetVal2()
{
return 11;
}
}
namespace TestsB
{
class TestsB0
{
[Test]
static void TestSharedData()
{
LibClassA ca = scope LibClassA(123);
Test.Assert(ca.mA == 7);
// From LibB. We don't have LibC as a dep so we can access this member.
Test.Assert(ca.mB == 1008);
Test.Assert(ca.mC == 9);
Test.Assert(ca.GetVal2() == 11);
ca = scope LibClassA();
Test.Assert(ca.mA == 7);
Test.Assert(ca.mB == 10008);
Test.Assert(ca.mC == 9);
// Should call the int32 ctor, not the unreachable LibC int8 ctor
ca = scope LibClassA((int8)123);
Test.Assert(ca.mA == 7);
Test.Assert(ca.mB == 1008);
Test.Assert(ca.mC == 9);
Test.Assert(ca.GetVal2() == 11);
}
}
}