1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-05 19:19:10 +08:00

chore: update go and tools (#537)

Update to the oldest supported release of go v1.22 at this time.

Update golangci-lint to 1.61.0 and address all issues.

Update actions to the latest versions.
This commit is contained in:
Steven Hartland 2024-11-03 16:40:47 +00:00 committed by GitHub
parent a81d9a55bf
commit aefc75aabc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 58 additions and 68 deletions

View File

@ -11,16 +11,16 @@ jobs:
runs-on: [ubuntu-latest] runs-on: [ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v5
with: with:
go-version: 1.19 go-version: 1.23
cache: true cache: true
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3 uses: goreleaser/goreleaser-action@v6
with: with:
# either 'goreleaser' (default) or 'goreleaser-pro' # either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser distribution: goreleaser

View File

@ -8,8 +8,8 @@ jobs:
go-test-lint: go-test-lint:
strategy: strategy:
matrix: matrix:
go: [1.21, 1.22] go: [1.22, 1.23]
golangcli: [v1.57.2] golangcli: [v1.61.0]
os: [ubuntu-latest] os: [ubuntu-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:

View File

@ -15,6 +15,9 @@ linters-settings:
rules: rules:
- name: var-naming - name: var-naming
disabled: true disabled: true
gosec:
excludes:
- G115 # Too many false positives.
linters: linters:
enable-all: true enable-all: true
@ -23,14 +26,13 @@ linters:
- lll - lll
- gochecknoglobals - gochecknoglobals
- gochecknoinits - gochecknoinits
- scopelint
- funlen - funlen
- godox - godox
- exhaustivestruct - err113
- goerr113
- wsl - wsl
- nlreturn - nlreturn
- gomnd - gomnd
- mnd
- paralleltest - paralleltest
- wrapcheck - wrapcheck
- testpackage - testpackage
@ -44,20 +46,13 @@ linters:
- maintidx - maintidx
- ireturn - ireturn
- exhaustruct - exhaustruct
- nosnakecase
- dupword - dupword
- structcheck
- deadcode
- golint
- varcheck
- ifshort
- interfacer
- maligned
# Just causes noise # Just causes noise
- depguard - depguard
# Go 1.22+ only # Deprecated
- copyloopvar - execinquery
- intrange # Not needed in go 1.22+
- exportloopref
issues: issues:
exclude-use-default: false exclude-use-default: false
@ -73,4 +68,6 @@ issues:
# Field alignment in tests isn't a performance issue. # Field alignment in tests isn't a performance issue.
- text: fieldalignment - text: fieldalignment
path: _test\.go path: _test\.go
- text: Error return value of `fmt\.Fprint.*` is not checked
path: tools/tester/main.go

View File

@ -43,7 +43,7 @@ func builtinArrayToLocaleString(call FunctionCall) Value {
return stringValue("") return stringValue("")
} }
stringList := make([]string, 0, length) stringList := make([]string, 0, length)
for index := int64(0); index < length; index++ { for index := range length {
value := thisObject.get(arrayIndexToString(index)) value := thisObject.get(arrayIndexToString(index))
stringValue := "" stringValue := ""
switch value.kind { switch value.kind {
@ -71,7 +71,7 @@ func builtinArrayConcat(call FunctionCall) Value {
obj := item.object() obj := item.object()
if isArray(obj) { if isArray(obj) {
length := obj.get(propertyLength).number().int64 length := obj.get(propertyLength).number().int64
for index := int64(0); index < length; index++ { for index := range length {
name := strconv.FormatInt(index, 10) name := strconv.FormatInt(index, 10)
if obj.hasProperty(name) { if obj.hasProperty(name) {
valueArray = append(valueArray, obj.get(name)) valueArray = append(valueArray, obj.get(name))
@ -151,7 +151,7 @@ func builtinArrayJoin(call FunctionCall) Value {
return stringValue("") return stringValue("")
} }
stringList := make([]string, 0, length) stringList := make([]string, 0, length)
for index := int64(0); index < length; index++ { for index := range length {
value := thisObject.get(arrayIndexToString(index)) value := thisObject.get(arrayIndexToString(index))
stringValue := "" stringValue := ""
switch value.kind { switch value.kind {
@ -175,7 +175,7 @@ func builtinArraySplice(call FunctionCall) Value {
} }
valueArray := make([]Value, deleteCount) valueArray := make([]Value, deleteCount)
for index := int64(0); index < deleteCount; index++ { for index := range deleteCount {
indexString := arrayIndexToString(start + index) indexString := arrayIndexToString(start + index)
if thisObject.hasProperty(indexString) { if thisObject.hasProperty(indexString) {
valueArray[index] = thisObject.get(indexString) valueArray[index] = thisObject.get(indexString)
@ -236,7 +236,7 @@ func builtinArraySplice(call FunctionCall) Value {
} }
} }
for index := int64(0); index < itemCount; index++ { for index := range itemCount {
thisObject.put(arrayIndexToString(index+start), itemList[index], true) thisObject.put(arrayIndexToString(index+start), itemList[index], true)
} }
thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true) thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true)
@ -257,7 +257,7 @@ func builtinArraySlice(call FunctionCall) Value {
sliceLength := end - start sliceLength := end - start
sliceValueArray := make([]Value, sliceLength) sliceValueArray := make([]Value, sliceLength)
for index := int64(0); index < sliceLength; index++ { for index := range sliceLength {
from := arrayIndexToString(index + start) from := arrayIndexToString(index + start)
if thisObject.hasProperty(from) { if thisObject.hasProperty(from) {
sliceValueArray[index] = thisObject.get(from) sliceValueArray[index] = thisObject.get(from)
@ -283,7 +283,7 @@ func builtinArrayUnshift(call FunctionCall) Value {
} }
} }
for index := int64(0); index < itemCount; index++ { for index := range itemCount {
thisObject.put(arrayIndexToString(index), itemList[index], true) thisObject.put(arrayIndexToString(index), itemList[index], true)
} }
@ -531,7 +531,7 @@ func builtinArrayEvery(call FunctionCall) Value {
if iterator := call.Argument(0); iterator.isCallable() { if iterator := call.Argument(0); iterator.isCallable() {
length := int64(toUint32(thisObject.get(propertyLength))) length := int64(toUint32(thisObject.get(propertyLength)))
callThis := call.Argument(1) callThis := call.Argument(1)
for index := int64(0); index < length; index++ { for index := range length {
if key := arrayIndexToString(index); thisObject.hasProperty(key) { if key := arrayIndexToString(index); thisObject.hasProperty(key) {
if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() { if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
continue continue
@ -550,7 +550,7 @@ func builtinArraySome(call FunctionCall) Value {
if iterator := call.Argument(0); iterator.isCallable() { if iterator := call.Argument(0); iterator.isCallable() {
length := int64(toUint32(thisObject.get(propertyLength))) length := int64(toUint32(thisObject.get(propertyLength)))
callThis := call.Argument(1) callThis := call.Argument(1)
for index := int64(0); index < length; index++ { for index := range length {
if key := arrayIndexToString(index); thisObject.hasProperty(key) { if key := arrayIndexToString(index); thisObject.hasProperty(key) {
if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() { if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
return trueValue return trueValue
@ -568,7 +568,7 @@ func builtinArrayForEach(call FunctionCall) Value {
if iterator := call.Argument(0); iterator.isCallable() { if iterator := call.Argument(0); iterator.isCallable() {
length := int64(toUint32(thisObject.get(propertyLength))) length := int64(toUint32(thisObject.get(propertyLength)))
callThis := call.Argument(1) callThis := call.Argument(1)
for index := int64(0); index < length; index++ { for index := range length {
if key := arrayIndexToString(index); thisObject.hasProperty(key) { if key := arrayIndexToString(index); thisObject.hasProperty(key) {
iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this) iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this)
} }
@ -585,7 +585,7 @@ func builtinArrayMap(call FunctionCall) Value {
length := int64(toUint32(thisObject.get(propertyLength))) length := int64(toUint32(thisObject.get(propertyLength)))
callThis := call.Argument(1) callThis := call.Argument(1)
values := make([]Value, length) values := make([]Value, length)
for index := int64(0); index < length; index++ { for index := range length {
if key := arrayIndexToString(index); thisObject.hasProperty(key) { if key := arrayIndexToString(index); thisObject.hasProperty(key) {
values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this) values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this)
} else { } else {
@ -604,7 +604,7 @@ func builtinArrayFilter(call FunctionCall) Value {
length := int64(toUint32(thisObject.get(propertyLength))) length := int64(toUint32(thisObject.get(propertyLength)))
callThis := call.Argument(1) callThis := call.Argument(1)
values := make([]Value, 0) values := make([]Value, 0)
for index := int64(0); index < length; index++ { for index := range length {
if key := arrayIndexToString(index); thisObject.hasProperty(key) { if key := arrayIndexToString(index); thisObject.hasProperty(key) {
value := thisObject.get(key) value := thisObject.get(key)
if iterator.call(call.runtime, callThis, value, index, this).bool() { if iterator.call(call.runtime, callThis, value, index, this).bool() {

View File

@ -129,7 +129,7 @@ func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLocal bool)
} }
valueList := make([]int, argumentLimit) valueList := make([]int, argumentLimit)
for index := 0; index < argumentLimit; index++ { for index := range argumentLimit {
value := call.ArgumentList[index] value := call.ArgumentList[index]
nm := value.number() nm := value.number()
switch nm.kind { switch nm.kind {

View File

@ -85,7 +85,7 @@ func builtinFunctionApply(call FunctionCall) Value {
thisObject := call.thisObject() thisObject := call.thisObject()
length := int64(toUint32(arrayObject.get(propertyLength))) length := int64(toUint32(arrayObject.get(propertyLength)))
valueArray := make([]Value, length) valueArray := make([]Value, length)
for index := int64(0); index < length; index++ { for index := range length {
valueArray[index] = arrayObject.get(arrayIndexToString(index)) valueArray[index] = arrayObject.get(arrayIndexToString(index))
} }
return thisObject.call(this, valueArray, false, nativeFrame) return thisObject.call(this, valueArray, false, nativeFrame)

View File

@ -44,7 +44,7 @@ func builtinJSONReviveWalk(ctx builtinJSONParseContext, holder *object, name str
if obj := value.object(); obj != nil { if obj := value.object(); obj != nil {
if isArray(obj) { if isArray(obj) {
length := int64(objectLength(obj)) length := int64(objectLength(obj))
for index := int64(0); index < length; index++ { for index := range length {
idxName := arrayIndexToString(index) idxName := arrayIndexToString(index)
idxValue := builtinJSONReviveWalk(ctx, obj, idxName) idxValue := builtinJSONReviveWalk(ctx, obj, idxName)
if idxValue.IsUndefined() { if idxValue.IsUndefined() {

View File

@ -163,7 +163,7 @@ func builtinStringMatch(call FunctionCall) Value {
} }
matchCount := len(result) matchCount := len(result)
valueArray := make([]Value, matchCount) valueArray := make([]Value, matchCount)
for index := 0; index < matchCount; index++ { for index := range matchCount {
valueArray[index] = stringValue(target[result[index][0]:result[index][1]]) valueArray[index] = stringValue(target[result[index][0]:result[index][1]])
} }
matcher.put("lastIndex", intValue(result[matchCount-1][1]), true) matcher.put("lastIndex", intValue(result[matchCount-1][1]), true)
@ -246,7 +246,7 @@ func builtinStringReplace(call FunctionCall) Value {
} }
matchCount := len(match) / 2 matchCount := len(match) / 2
argumentList := make([]Value, matchCount+2) argumentList := make([]Value, matchCount+2)
for index := 0; index < matchCount; index++ { for index := range matchCount {
offset := 2 * index offset := 2 * index
if match[offset] != -1 { if match[offset] != -1 {
argumentList[index] = stringValue(target[match[offset]:match[offset+1]]) argumentList[index] = stringValue(target[match[offset]:match[offset+1]])

View File

@ -15,12 +15,12 @@ func formatForConsole(argumentList []Value) string {
} }
func builtinConsoleLog(call FunctionCall) Value { func builtinConsoleLog(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
return Value{} return Value{}
} }
func builtinConsoleError(call FunctionCall) Value { func builtinConsoleError(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
return Value{} return Value{}
} }

View File

@ -148,7 +148,7 @@ func newError(rt *runtime, name string, stackFramesToPop int, in ...interface{})
if rt != nil && rt.scope != nil { if rt != nil && rt.scope != nil {
curScope := rt.scope curScope := rt.scope
for i := 0; i < stackFramesToPop; i++ { for range stackFramesToPop {
if curScope.outer != nil { if curScope.outer != nil {
curScope = curScope.outer curScope = curScope.outer
} }

View File

@ -123,7 +123,7 @@ func benchmarkGoSliceSort(b *testing.B, size int, sortFuncCall string, sortCode
b.Helper() b.Helper()
// generate arbitrary slice of 'size' // generate arbitrary slice of 'size'
testSlice := make([]int, size) testSlice := make([]int, size)
for i := 0; i < size; i++ { for i := range size {
testSlice[i] = rand.Int() //nolint:gosec testSlice[i] = rand.Int() //nolint:gosec
} }

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/robertkrimen/otto module github.com/robertkrimen/otto
go 1.18 go 1.22
require ( require (
github.com/stretchr/testify v1.8.1 github.com/stretchr/testify v1.8.1

View File

@ -114,7 +114,7 @@ func (p *parser) scanIdentifier() (string, error) {
} }
parse = true parse = true
var value rune var value rune
for j := 0; j < 4; j++ { for range 4 {
p.read() p.read()
decimal, ok := hex2decimal(byte(p.chr)) decimal, ok := hex2decimal(byte(p.chr))
if !ok { if !ok {
@ -764,7 +764,7 @@ func parseStringLiteral(literal string) (string, error) {
if len(str) < size { if len(str) < size {
return "", fmt.Errorf("invalid escape: \\%s: len(%q) != %d", string(chr), str, size) return "", fmt.Errorf("invalid escape: \\%s: len(%q) != %d", string(chr), str, size)
} }
for j := 0; j < size; j++ { for j := range size {
decimal, ok := hex2decimal(str[j]) decimal, ok := hex2decimal(str[j])
if !ok { if !ok {
return "", fmt.Errorf("invalid escape: \\%s: %q", string(chr), str[:size]) return "", fmt.Errorf("invalid escape: \\%s: %q", string(chr), str[:size])

View File

@ -24,7 +24,7 @@ func marshal(name string, children ...interface{}) interface{} {
} }
ret := map[string]interface{}{} ret := map[string]interface{}{}
length := len(children) / 2 length := len(children) / 2
for i := 0; i < length; i++ { for i := range length {
name := children[i*2].(string) name := children[i*2].(string)
value := children[i*2+1] value := children[i*2+1]
ret[name] = value ret[name] = value
@ -168,7 +168,7 @@ func testMarshalNode(node interface{}) interface{} {
value := reflect.ValueOf(node) value := reflect.ValueOf(node)
if value.Kind() == reflect.Slice { if value.Kind() == reflect.Slice {
tmp0 := []interface{}{} tmp0 := []interface{}{}
for index := 0; index < value.Len(); index++ { for index := range value.Len() {
tmp0 = append(tmp0, testMarshalNode(value.Index(index).Interface())) tmp0 = append(tmp0, testMarshalNode(value.Index(index).Interface()))
} }
return tmp0 return tmp0

View File

@ -293,7 +293,7 @@ func fieldIndexByName(t reflect.Type, name string) []int {
t = t.Elem() t = t.Elem()
} }
for i := 0; i < t.NumField(); i++ { for i := range t.NumField() {
f := t.Field(i) f := t.Field(i)
if !validGoStructName(f.Name) { if !validGoStructName(f.Name) {
@ -430,7 +430,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
switch o.class { switch o.class {
case classArrayName: case classArrayName:
for i := int64(0); i < l; i++ { for i := range l {
p, ok := o.property[strconv.FormatInt(i, 10)] p, ok := o.property[strconv.FormatInt(i, 10)]
if !ok { if !ok {
continue continue
@ -457,7 +457,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
gslice = false gslice = false
} }
for i := int64(0); i < l; i++ { for i := range l {
var p *property var p *property
if gslice { if gslice {
p = goSliceGetOwnProperty(o, strconv.FormatInt(i, 10)) p = goSliceGetOwnProperty(o, strconv.FormatInt(i, 10))
@ -601,7 +601,7 @@ func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value,
if v.kind == valueString { if v.kind == valueString {
var s encoding.TextUnmarshaler var s encoding.TextUnmarshaler
if reflect.PtrTo(t).Implements(reflect.TypeOf(&s).Elem()) { if reflect.PointerTo(t).Implements(reflect.TypeOf(&s).Elem()) {
r := reflect.New(t) r := reflect.New(t)
if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil { if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil {

View File

@ -67,13 +67,6 @@ var broken = map[string]string{
"sendbird-calls.js": "runtime: out of memory", "sendbird-calls.js": "runtime: out of memory",
} }
func min(a, b int) int {
if a > b {
return b
}
return a
}
// libraries represents fetch all libraries response. // libraries represents fetch all libraries response.
type libraries struct { type libraries struct {
Results []library `json:"results"` Results []library `json:"results"`
@ -203,7 +196,7 @@ func fetchAll(src string) error {
work := make(chan library, downloadWorkers) work := make(chan library, downloadWorkers)
errs := make(chan error, len(libs.Results)) errs := make(chan error, len(libs.Results))
wg.Add(downloadWorkers) wg.Add(downloadWorkers)
for i := 0; i < downloadWorkers; i++ { for range downloadWorkers {
go func() { go func() {
defer wg.Done() defer wg.Done()
for lib := range work { for lib := range work {
@ -261,7 +254,7 @@ func report(files []string) error {
work := make(chan string, workers) work := make(chan string, workers)
results := make(chan result, len(files)) results := make(chan result, len(files))
wg.Add(workers) wg.Add(workers)
for i := 0; i < workers; i++ { for range workers {
go func() { go func() {
defer wg.Done() defer wg.Done()
for f := range work { for f := range work {

View File

@ -97,7 +97,7 @@ func goStructEnumerate(obj *object, all bool, each func(string) bool) {
goObj := obj.value.(*goStructObject) goObj := obj.value.(*goStructObject)
// Enumerate fields // Enumerate fields
for index := 0; index < reflect.Indirect(goObj.value).NumField(); index++ { for index := range reflect.Indirect(goObj.value).NumField() {
name := reflect.Indirect(goObj.value).Type().Field(index).Name name := reflect.Indirect(goObj.value).Type().Field(index).Name
if validGoStructName(name) { if validGoStructName(name) {
if !each(name) { if !each(name) {
@ -107,7 +107,7 @@ func goStructEnumerate(obj *object, all bool, each func(string) bool) {
} }
// Enumerate methods // Enumerate methods
for index := 0; index < goObj.value.NumMethod(); index++ { for index := range goObj.value.NumMethod() {
name := goObj.value.Type().Method(index).Name name := goObj.value.Type().Method(index).Name
if validGoStructName(name) { if validGoStructName(name) {
if !each(name) { if !each(name) {

View File

@ -124,7 +124,7 @@ func execRegExp(this *object, target string) (bool, []int) {
func execResultToArray(rt *runtime, target string, result []int) *object { func execResultToArray(rt *runtime, target string, result []int) *object {
captureCount := len(result) / 2 captureCount := len(result) / 2
valueArray := make([]Value, captureCount) valueArray := make([]Value, captureCount)
for index := 0; index < captureCount; index++ { for index := range captureCount {
offset := 2 * index offset := 2 * index
if result[offset] != -1 { if result[offset] != -1 {
valueArray[index] = stringValue(target[result[offset]:result[offset+1]]) valueArray[index] = stringValue(target[result[offset]:result[offset+1]])

View File

@ -50,7 +50,7 @@ func (str stringWide) String() string {
} }
func newStringObject(str string) stringObjecter { func newStringObject(str string) stringObjecter {
for i := 0; i < len(str); i++ { for i := range len(str) {
if str[i] >= utf8.RuneSelf { if str[i] >= utf8.RuneSelf {
goto wide goto wide
} }
@ -91,7 +91,7 @@ func (o *object) stringValue() stringObjecter {
func stringEnumerate(obj *object, all bool, each func(string) bool) { func stringEnumerate(obj *object, all bool, each func(string) bool) {
if str := obj.stringValue(); str != nil { if str := obj.stringValue(); str != nil {
length := str.Length() length := str.Length()
for index := 0; index < length; index++ { for index := range length {
if !each(strconv.FormatInt(int64(index), 10)) { if !each(strconv.FormatInt(int64(index), 10)) {
return return
} }

View File

@ -647,7 +647,7 @@ func (v Value) export() interface{} {
elemKind := reflect.Invalid elemKind := reflect.Invalid
state := 0 state := 0
var t reflect.Type var t reflect.Type
for index := uint32(0); index < length; index++ { for index := range length {
name := strconv.FormatInt(int64(index), 10) name := strconv.FormatInt(int64(index), 10)
if !obj.hasProperty(name) { if !obj.hasProperty(name) {
continue continue

View File

@ -177,7 +177,7 @@ func Test_toInt32(t *testing.T) {
math.Inf(+1), int32(0), math.Inf(+1), int32(0),
math.Inf(-1), int32(0), math.Inf(-1), int32(0),
} }
for index := 0; index < len(test)/2; index++ { for index := range len(test) / 2 {
// FIXME terst, Make strict again? // FIXME terst, Make strict again?
is( is(
toInt32(toValue(test[index*2])), toInt32(toValue(test[index*2])),
@ -199,7 +199,7 @@ func Test_toUint32(t *testing.T) {
math.Inf(+1), uint32(0), math.Inf(+1), uint32(0),
math.Inf(-1), uint32(0), math.Inf(-1), uint32(0),
} }
for index := 0; index < len(test)/2; index++ { for index := range len(test) / 2 {
// FIXME terst, Make strict again? // FIXME terst, Make strict again?
is( is(
toUint32(toValue(test[index*2])), toUint32(toValue(test[index*2])),
@ -221,7 +221,7 @@ func Test_toUint16(t *testing.T) {
math.Inf(+1), uint16(0), math.Inf(+1), uint16(0),
math.Inf(-1), uint16(0), math.Inf(-1), uint16(0),
} }
for index := 0; index < len(test)/2; index++ { for index := range len(test) / 2 {
// FIXME terst, Make strict again? // FIXME terst, Make strict again?
is( is(
toUint16(toValue(test[index*2])), toUint16(toValue(test[index*2])),