Added overloaded support for array * int
This commit is contained in:
@@ -343,6 +343,17 @@ func TestArrayLiterals(t *testing.T) {
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestArrayDuplication(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{"[1] * 3", []int{1, 1, 1}},
|
||||
{"3 * [1]", []int{1, 1, 1}},
|
||||
{"[1, 2] * 2", []int{1, 2, 1, 2}},
|
||||
{"2 * [1, 2]", []int{1, 2, 1, 2}},
|
||||
}
|
||||
|
||||
runVmTests(t, tests)
|
||||
}
|
||||
|
||||
func TestHashLiterals(t *testing.T) {
|
||||
tests := []vmTestCase{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user