| 1 |
// +build js |
| 2 |
|
| 3 |
package reflect_test |
| 4 |
|
| 5 |
import ( |
| 6 |
"math" |
| 7 |
"reflect" |
| 8 |
"testing" |
| 9 |
) |
| 10 |
|
| 11 |
func TestAlignment(t *testing.T) { |
| 12 |
t.Skip() |
| 13 |
} |
| 14 |
|
| 15 |
func TestSliceOverflow(t *testing.T) { |
| 16 |
t.Skip() |
| 17 |
} |
| 18 |
|
| 19 |
func TestFuncLayout(t *testing.T) { |
| 20 |
t.Skip() |
| 21 |
} |
| 22 |
|
| 23 |
func TestArrayOfDirectIface(t *testing.T) { |
| 24 |
t.Skip() |
| 25 |
} |
| 26 |
|
| 27 |
func TestTypelinksSorted(t *testing.T) { |
| 28 |
t.Skip() |
| 29 |
} |
| 30 |
|
| 31 |
func TestGCBits(t *testing.T) { |
| 32 |
t.Skip() |
| 33 |
} |
| 34 |
|
| 35 |
func TestChanAlloc(t *testing.T) { |
| 36 |
t.Skip() |
| 37 |
} |
| 38 |
|
| 39 |
func TestNameBytesAreAligned(t *testing.T) { |
| 40 |
t.Skip() |
| 41 |
} |
| 42 |
|
| 43 |
func TestOffsetLock(t *testing.T) { |
| 44 |
t.Skip() |
| 45 |
} |
| 46 |
|
| 47 |
func TestSelectOnInvalid(t *testing.T) { |
| 48 |
reflect.Select([]reflect.SelectCase{ |
| 49 |
{ |
| 50 |
Dir: reflect.SelectRecv, |
| 51 |
Chan: reflect.Value{}, |
| 52 |
}, { |
| 53 |
Dir: reflect.SelectSend, |
| 54 |
Chan: reflect.Value{}, |
| 55 |
Send: reflect.ValueOf(1), |
| 56 |
}, { |
| 57 |
Dir: reflect.SelectDefault, |
| 58 |
}, |
| 59 |
}) |
| 60 |
} |
| 61 |
|
| 62 |
func TestStructOfFieldName(t *testing.T) { |
| 63 |
t.Skip("StructOf") |
| 64 |
} |
| 65 |
|
| 66 |
func TestStructOf(t *testing.T) { |
| 67 |
t.Skip("StructOf") |
| 68 |
} |
| 69 |
|
| 70 |
func TestStructOfExportRules(t *testing.T) { |
| 71 |
t.Skip("StructOf") |
| 72 |
} |
| 73 |
|
| 74 |
func TestStructOfGC(t *testing.T) { |
| 75 |
t.Skip("StructOf") |
| 76 |
} |
| 77 |
|
| 78 |
func TestStructOfAlg(t *testing.T) { |
| 79 |
t.Skip("StructOf") |
| 80 |
} |
| 81 |
|
| 82 |
func TestStructOfGenericAlg(t *testing.T) { |
| 83 |
t.Skip("StructOf") |
| 84 |
} |
| 85 |
|
| 86 |
func TestStructOfDirectIface(t *testing.T) { |
| 87 |
t.Skip("StructOf") |
| 88 |
} |
| 89 |
|
| 90 |
func TestStructOfWithInterface(t *testing.T) { |
| 91 |
t.Skip("StructOf") |
| 92 |
} |
| 93 |
|
| 94 |
var deepEqualTests = []DeepEqualTest{ |
| 95 |
// Equalities |
| 96 |
{nil, nil, true}, |
| 97 |
{1, 1, true}, |
| 98 |
{int32(1), int32(1), true}, |
| 99 |
{0.5, 0.5, true}, |
| 100 |
{float32(0.5), float32(0.5), true}, |
| 101 |
{"hello", "hello", true}, |
| 102 |
{make([]int, 10), make([]int, 10), true}, |
| 103 |
{&[3]int{1, 2, 3}, &[3]int{1, 2, 3}, true}, |
| 104 |
{Basic{1, 0.5}, Basic{1, 0.5}, true}, |
| 105 |
{error(nil), error(nil), true}, |
| 106 |
{map[int]string{1: "one", 2: "two"}, map[int]string{2: "two", 1: "one"}, true}, |
| 107 |
{fn1, fn2, true}, |
| 108 |
|
| 109 |
// Inequalities |
| 110 |
{1, 2, false}, |
| 111 |
{int32(1), int32(2), false}, |
| 112 |
{0.5, 0.6, false}, |
| 113 |
{float32(0.5), float32(0.6), false}, |
| 114 |
{"hello", "hey", false}, |
| 115 |
{make([]int, 10), make([]int, 11), false}, |
| 116 |
{&[3]int{1, 2, 3}, &[3]int{1, 2, 4}, false}, |
| 117 |
{Basic{1, 0.5}, Basic{1, 0.6}, false}, |
| 118 |
{Basic{1, 0}, Basic{2, 0}, false}, |
| 119 |
{map[int]string{1: "one", 3: "two"}, map[int]string{2: "two", 1: "one"}, false}, |
| 120 |
{map[int]string{1: "one", 2: "txo"}, map[int]string{2: "two", 1: "one"}, false}, |
| 121 |
{map[int]string{1: "one"}, map[int]string{2: "two", 1: "one"}, false}, |
| 122 |
{map[int]string{2: "two", 1: "one"}, map[int]string{1: "one"}, false}, |
| 123 |
{nil, 1, false}, |
| 124 |
{1, nil, false}, |
| 125 |
{fn1, fn3, false}, |
| 126 |
{fn3, fn3, false}, |
| 127 |
{[][]int{{1}}, [][]int{{2}}, false}, |
| 128 |
{math.NaN(), math.NaN(), false}, |
| 129 |
{&[1]float64{math.NaN()}, &[1]float64{math.NaN()}, false}, |
| 130 |
{&[1]float64{math.NaN()}, self{}, true}, |
| 131 |
{[]float64{math.NaN()}, []float64{math.NaN()}, false}, |
| 132 |
{[]float64{math.NaN()}, self{}, true}, |
| 133 |
{map[float64]float64{math.NaN(): 1}, map[float64]float64{1: 2}, false}, |
| 134 |
{map[float64]float64{math.NaN(): 1}, self{}, true}, |
| 135 |
|
| 136 |
// Nil vs empty: not the same. |
| 137 |
{[]int{}, []int(nil), false}, |
| 138 |
{[]int{}, []int{}, true}, |
| 139 |
{[]int(nil), []int(nil), true}, |
| 140 |
{map[int]int{}, map[int]int(nil), false}, |
| 141 |
{map[int]int{}, map[int]int{}, true}, |
| 142 |
{map[int]int(nil), map[int]int(nil), true}, |
| 143 |
|
| 144 |
// Mismatched types |
| 145 |
{1, 1.0, false}, |
| 146 |
{int32(1), int64(1), false}, |
| 147 |
{0.5, "hello", false}, |
| 148 |
{[]int{1, 2, 3}, [3]int{1, 2, 3}, false}, |
| 149 |
{&[3]interface{}{1, 2, 4}, &[3]interface{}{1, 2, "s"}, false}, |
| 150 |
{Basic{1, 0.5}, NotBasic{1, 0.5}, false}, |
| 151 |
{map[uint]string{1: "one", 2: "two"}, map[int]string{2: "two", 1: "one"}, false}, |
| 152 |
|
| 153 |
// Possible loops. |
| 154 |
{&loop1, &loop1, true}, |
| 155 |
//{&loop1, &loop2, true}, // TODO: Fix. |
| 156 |
{&loopy1, &loopy1, true}, |
| 157 |
//{&loopy1, &loopy2, true}, // TODO: Fix. |
| 158 |
} |