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

Adding new test suite

This commit is contained in:
Brian Fiete 2019-11-07 06:49:32 -08:00
parent a13042b96c
commit 61b440ea36
6 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,5 @@
FileVersion = 1
[Project]
Name = "Test"
StartupObject = "Test.Program"

View file

@ -0,0 +1,5 @@
FileVersion = 1
Projects = {Test = {Path = "."}}
[Workspace]
StartupProject = "Test"

View file

@ -0,0 +1,22 @@
# This ensures that we entry [4] remains open even after removing them item above it
ShowFile("src/Container.bf")
GotoText("//TestA")
ToggleBreakpoint()
GotoText("//TestB")
ToggleBreakpoint()
RunWithCompiling()
ShowWatches()
AddWatch("list")
SelectWatch("list")
OpenSelectedWatches()
SelectWatch("[4]")
OpenSelectedWatches()
FocusWatchDir(2)
AssertSelectedWatchEquals("5")
StepOver()
SelectWatch("[4]")
FocusWatchDir(2)
AssertSelectedWatchEquals("6")
Continue()
SelectWatch("[4]")
AssertSelectedWatchEquals("4")

View file

@ -0,0 +1,43 @@
using System.Collections.Generic;
using System;
namespace Test
{
class Container
{
static void TestB()
{
List<int> list = scope .();
for (int i < 5)
list.Add(i);
//TestB
list.Remove(2);
}
static void TestA()
{
List<String> list = scope .();
list.Add("A");
list.Add("AB");
list.Add("ABC");
list.Add("ABCD");
list.Add("ABCDE");
list.Add("ABCDEF");
for (int i < 100)
{
list.Add(scope:: String()..AppendF("Str{}", i));
}
//TestA
list.RemoveAt(3);
TestB();
}
public static void Test()
{
TestA();
}
}
}

View file

@ -0,0 +1,14 @@
#pragma warning disable 168
using System;
namespace Test
{
class Program
{
static void Main()
{
Container.Test();
}
}
}

View file

@ -19,6 +19,10 @@ PUSHD %~dp0..\
@CALL :TEST @CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR @IF !ERRORLEVEL! NEQ 0 GOTO HADERROR
@SET TESTPATH=IDE\Tests\DebuggerTests
@CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR
@SET TESTPATH=IDE\Tests\TestDynCrt1 @SET TESTPATH=IDE\Tests\TestDynCrt1
@CALL :TEST @CALL :TEST
@IF !ERRORLEVEL! NEQ 0 GOTO HADERROR @IF !ERRORLEVEL! NEQ 0 GOTO HADERROR