2015-09-15 21:43:53 +02:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package gc
|
|
|
|
|
|
2015-09-19 23:55:27 +02:00
|
|
|
import (
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
"cmd/compile/internal/types"
|
2015-09-19 23:55:27 +02:00
|
|
|
"reflect"
|
2016-02-26 13:03:11 -08:00
|
|
|
"sort"
|
2015-09-19 23:55:27 +02:00
|
|
|
"testing"
|
|
|
|
|
)
|
2015-09-15 21:43:53 +02:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
func typeWithoutPointers() *types.Type {
|
|
|
|
|
t := types.New(TSTRUCT)
|
|
|
|
|
f := &types.Field{Type: types.New(TINT)}
|
|
|
|
|
t.SetFields([]*types.Field{f})
|
2017-03-29 21:04:00 -07:00
|
|
|
return t
|
2016-04-01 20:11:30 -07:00
|
|
|
}
|
|
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
func typeWithPointers() *types.Type {
|
|
|
|
|
t := types.New(TSTRUCT)
|
|
|
|
|
f := &types.Field{Type: types.New(TPTR64)}
|
|
|
|
|
t.SetFields([]*types.Field{f})
|
2017-03-29 21:04:00 -07:00
|
|
|
return t
|
2016-04-01 20:11:30 -07:00
|
|
|
}
|
|
|
|
|
|
2015-09-15 21:43:53 +02:00
|
|
|
// Test all code paths for cmpstackvarlt.
|
|
|
|
|
func TestCmpstackvar(t *testing.T) {
|
|
|
|
|
testdata := []struct {
|
|
|
|
|
a, b Node
|
|
|
|
|
lt bool
|
|
|
|
|
}{
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PAUTO},
|
|
|
|
|
Node{Class: PFUNC},
|
|
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PFUNC},
|
|
|
|
|
Node{Class: PAUTO},
|
|
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 0},
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 10},
|
|
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 20},
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 10},
|
|
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 10},
|
|
|
|
|
Node{Class: PFUNC, Xoffset: 10},
|
|
|
|
|
false,
|
|
|
|
|
},
|
2016-02-20 21:36:12 -08:00
|
|
|
{
|
|
|
|
|
Node{Class: PPARAM, Xoffset: 10},
|
|
|
|
|
Node{Class: PPARAMOUT, Xoffset: 20},
|
|
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Node{Class: PPARAMOUT, Xoffset: 10},
|
|
|
|
|
Node{Class: PPARAM, Xoffset: 20},
|
|
|
|
|
true,
|
|
|
|
|
},
|
2015-09-15 21:43:53 +02:00
|
|
|
{
|
2017-02-27 19:56:38 +02:00
|
|
|
Node{Class: PAUTO, flags: nodeUsed},
|
|
|
|
|
Node{Class: PAUTO},
|
2015-09-15 21:43:53 +02:00
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
2017-02-27 19:56:38 +02:00
|
|
|
Node{Class: PAUTO},
|
|
|
|
|
Node{Class: PAUTO, flags: nodeUsed},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
2016-04-01 20:11:30 -07:00
|
|
|
Node{Class: PAUTO, Type: typeWithoutPointers()},
|
|
|
|
|
Node{Class: PAUTO, Type: typeWithPointers()},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
2016-04-01 20:11:30 -07:00
|
|
|
Node{Class: PAUTO, Type: typeWithPointers()},
|
|
|
|
|
Node{Class: PAUTO, Type: typeWithoutPointers()},
|
2015-09-15 21:43:53 +02:00
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{flags: nameNeedzero}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}},
|
2015-09-15 21:43:53 +02:00
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{flags: nameNeedzero}},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{Width: 1}, Name: &Name{}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{Width: 2}, Name: &Name{}},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{Width: 2}, Name: &Name{}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{Width: 1}, Name: &Name{}},
|
2015-09-15 21:43:53 +02:00
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "xyz"}},
|
2015-09-15 21:43:53 +02:00
|
|
|
true,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "xyz"}},
|
|
|
|
|
Node{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
2015-09-15 21:43:53 +02:00
|
|
|
false,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
for _, d := range testdata {
|
|
|
|
|
got := cmpstackvarlt(&d.a, &d.b)
|
|
|
|
|
if got != d.lt {
|
|
|
|
|
t.Errorf("want %#v < %#v", d.a, d.b)
|
|
|
|
|
}
|
2016-02-20 21:36:12 -08:00
|
|
|
// If we expect a < b to be true, check that b < a is false.
|
|
|
|
|
if d.lt && cmpstackvarlt(&d.b, &d.a) {
|
|
|
|
|
t.Errorf("unexpected %#v < %#v", d.b, d.a)
|
|
|
|
|
}
|
2015-09-15 21:43:53 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-09-19 23:55:27 +02:00
|
|
|
|
2016-02-26 13:03:11 -08:00
|
|
|
func TestStackvarSort(t *testing.T) {
|
2015-09-19 23:55:27 +02:00
|
|
|
inp := []*Node{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
{Class: PFUNC, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 0, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 10, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 20, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, flags: nodeUsed, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: typeWithoutPointers(), Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{flags: nameNeedzero}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{Width: 1}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{Width: 2}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "xyz"}},
|
2015-09-19 23:55:27 +02:00
|
|
|
}
|
|
|
|
|
want := []*Node{
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
{Class: PFUNC, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 0, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 10, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PFUNC, Xoffset: 20, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, flags: nodeUsed, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{flags: nameNeedzero}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{Width: 2}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{Width: 1}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "abc"}},
|
|
|
|
|
{Class: PAUTO, Type: &types.Type{}, Name: &Name{}, Sym: &types.Sym{Name: "xyz"}},
|
|
|
|
|
{Class: PAUTO, Type: typeWithoutPointers(), Name: &Name{}, Sym: &types.Sym{}},
|
2015-09-19 23:55:27 +02:00
|
|
|
}
|
|
|
|
|
// haspointers updates Type.Haspointers as a side effect, so
|
|
|
|
|
// exercise this function on all inputs so that reflect.DeepEqual
|
|
|
|
|
// doesn't produce false positives.
|
|
|
|
|
for i := range want {
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
types.Haspointers(want[i].Type)
|
|
|
|
|
types.Haspointers(inp[i].Type)
|
2015-09-19 23:55:27 +02:00
|
|
|
}
|
|
|
|
|
|
2016-02-26 13:03:11 -08:00
|
|
|
sort.Sort(byStackVar(inp))
|
|
|
|
|
if !reflect.DeepEqual(want, inp) {
|
|
|
|
|
t.Error("sort failed")
|
|
|
|
|
for i := range inp {
|
|
|
|
|
g := inp[i]
|
2015-09-19 23:55:27 +02:00
|
|
|
w := want[i]
|
|
|
|
|
eq := reflect.DeepEqual(w, g)
|
|
|
|
|
if !eq {
|
|
|
|
|
t.Log(i, w, g)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|