mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-03 13:58:37 +00:00
2345858238
* refactored structs, the scope is not needed anymore + fix passing struct in func arguments. * implemented byte arrays and added runtime tests * Added sc examples in compiler README + added quick nested if test. * Updated README
57 lines
882 B
Go
57 lines
882 B
Go
package compiler
|
|
|
|
var boolTestCases = []testCase{
|
|
{
|
|
"bool assign",
|
|
`
|
|
package foo
|
|
func Main() bool {
|
|
x := true
|
|
return x
|
|
}
|
|
`,
|
|
"52c56b516c766b00527ac46203006c766b00c3616c7566",
|
|
},
|
|
{
|
|
"bool compare",
|
|
`
|
|
package foo
|
|
func Main() int {
|
|
x := true
|
|
if x {
|
|
return 10
|
|
}
|
|
return 0
|
|
}
|
|
`,
|
|
"54c56b516c766b00527ac46c766b00c3640b006203005a616c756662030000616c7566",
|
|
},
|
|
{
|
|
"bool compare verbose",
|
|
`
|
|
package foo
|
|
func Main() int {
|
|
x := true
|
|
if x == true {
|
|
return 10
|
|
}
|
|
return 0
|
|
}
|
|
`,
|
|
"54c56b516c766b00527ac46c766b00c3519c640b006203005a616c756662030000616c7566",
|
|
},
|
|
// {
|
|
// "bool invert (unary expr)",
|
|
// `
|
|
// package foo
|
|
// func Main() int {
|
|
// x := true
|
|
// if !x {
|
|
// return 10
|
|
// }
|
|
// return 0
|
|
// }
|
|
// `,
|
|
// "54c56b516c766b00527ac46c766b00c3630b006203005a616c756662030000616c7566",
|
|
// },
|
|
}
|