Wrote unit test for methods

This commit is contained in:
Sasha Koshka 2023-09-19 01:35:56 -04:00
parent f703dead1d
commit 0f7e2e3f10
1 changed files with 28 additions and 0 deletions

View File

@ -93,3 +93,31 @@ testString (test,
}
`)
}
func TestFunction (test *testing.T) {
testString (test,
// correct
`[arguments x:Int y:Int z:Int] = {}
[arrayArguments arg:4:54:23:28:(x:Int y:Int)] = {}`,
//input
`
[arguments x:Int y:Int z:Int] = { }
[arrayArguments arg:4:54:23:28:(x:Int y:Int)] = { }
`)
}
func TestMethod (test *testing.T) {
testString (test,
// correct
`BopIt: Int
BopIt.[bop force:UInt] = {}
BopIt.[twist angle:F64] = {}
BopIt.[pull distance:Int] = {}`,
//input
`
BopIt: Int
BopIt.[bop force:UInt] = { }
BopIt.[twist angle:F64] = { }
BopIt.[pull distance:Int] = { }
`)
}