From 206b508d38a384ec205b852c165f071f7ffc97e6 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 1 Sep 2020 06:37:02 -0700 Subject: [PATCH] Additional tests --- IDEHelper/Tests/src/Interfaces.bf | 5 +++++ IDEHelper/Tests/src/Operators.bf | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/IDEHelper/Tests/src/Interfaces.bf b/IDEHelper/Tests/src/Interfaces.bf index c723da57..88b4c5de 100644 --- a/IDEHelper/Tests/src/Interfaces.bf +++ b/IDEHelper/Tests/src/Interfaces.bf @@ -16,6 +16,11 @@ namespace Tests { FuncA(a + 100); } + + void FuncC(int a) mut + { + FuncB(a + 1000); + } } concrete interface IFaceC diff --git a/IDEHelper/Tests/src/Operators.bf b/IDEHelper/Tests/src/Operators.bf index 9063f38f..cdacfcd7 100644 --- a/IDEHelper/Tests/src/Operators.bf +++ b/IDEHelper/Tests/src/Operators.bf @@ -275,6 +275,11 @@ namespace Tests sVal.mA = val; return sVal; } + + public void operator++() mut + { + mA++; + } } [Test] @@ -283,6 +288,14 @@ namespace Tests IntStruct iVal = .(); Test.Assert(iVal == 123); Test.Assert(iVal == 123.0f); + + var iVal2 = iVal++; + var iVal3 = ++iVal; + ++iVal; + + Test.Assert(iVal == 126); + Test.Assert(iVal2 == 123); + Test.Assert(iVal3 == 125); } const String cStrD = "D";