mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Fixed some indenting issues, added indenting test
This commit is contained in:
parent
df4573dca1
commit
e5de09488e
7 changed files with 213 additions and 14 deletions
9
IDE/Tests/IndentTest/BeefProj.toml
Normal file
9
IDE/Tests/IndentTest/BeefProj.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
FileVersion = 1
|
||||
|
||||
[Project]
|
||||
Name = "IDETest"
|
||||
TargetType = "BeefWindowsApplication"
|
||||
StartupObject = "IDETest.Program"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
BeefLibType = "DynamicDebug"
|
12
IDE/Tests/IndentTest/BeefSpace.toml
Normal file
12
IDE/Tests/IndentTest/BeefSpace.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
FileVersion = 1
|
||||
Projects = {IDETest = {Path = "."}}
|
||||
Unlocked = ["corlib"]
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "IDETest"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
IntermediateType = "ObjectAndIRCode"
|
||||
|
||||
[Configs.Debug.Win32]
|
||||
IntermediateType = "ObjectAndIRCode"
|
46
IDE/Tests/IndentTest/scripts/Indent01.txt
Normal file
46
IDE/Tests/IndentTest/scripts/Indent01.txt
Normal file
|
@ -0,0 +1,46 @@
|
|||
ShowFile("src/Indent01.bf")
|
||||
|
||||
GotoText("//Test01")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 17)
|
||||
|
||||
GotoText("//Test02")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 21)
|
||||
|
||||
GotoText("//Test03")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 21)
|
||||
|
||||
GotoText("//Test04")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 25)
|
||||
|
||||
GotoText("//Test05")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 25)
|
||||
|
||||
GotoText("//Test06")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 21)
|
||||
|
||||
GotoText("//Test07")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 25)
|
||||
|
||||
GotoText("//Test08")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 21)
|
||||
|
||||
GotoText("//Test09")
|
||||
AdjustCursor(0, -1)
|
||||
CursorToLineEnd()
|
||||
AssertIsAtColumn("Indent01.bf", 17)
|
100
IDE/Tests/IndentTest/src/Indent01.bf
Normal file
100
IDE/Tests/IndentTest/src/Indent01.bf
Normal file
|
@ -0,0 +1,100 @@
|
|||
namespace IDETest
|
||||
{
|
||||
class Indent01
|
||||
{
|
||||
static void Test01()
|
||||
{
|
||||
if (true)
|
||||
|
||||
//Test01
|
||||
}
|
||||
|
||||
static void Test02()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
|
||||
//Test02
|
||||
}
|
||||
|
||||
static void Test03()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else
|
||||
|
||||
//Test03
|
||||
}
|
||||
|
||||
static void Test04()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
for ()
|
||||
|
||||
//Test04
|
||||
}
|
||||
|
||||
static void Test05()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else
|
||||
for ()
|
||||
|
||||
//Test05
|
||||
}
|
||||
|
||||
static void Test06()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else if (true)
|
||||
|
||||
//Test06
|
||||
}
|
||||
|
||||
static void Test07()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else if (true)
|
||||
for (int i < 10)
|
||||
|
||||
//Test07
|
||||
}
|
||||
|
||||
static void Test08()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else if (true)
|
||||
for (int i < 10)
|
||||
;
|
||||
else
|
||||
|
||||
//Test08
|
||||
}
|
||||
|
||||
static void Test09()
|
||||
{
|
||||
if (true)
|
||||
if (true)
|
||||
;
|
||||
else if (true)
|
||||
for (int i < 10)
|
||||
;
|
||||
else
|
||||
;
|
||||
|
||||
for (int i < 20)
|
||||
|
||||
//Test09
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue