• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:reason

2 // Use of this source code is governed by a BSD-style
20 "github.com/google/go-cmp/cmp"
106 reason string // The reason for the expected outcome
112 reason: "not equal because empty non-nil and nil slice differ",
119 reason: "equal because EquateEmpty equates empty slices",
125 reason: "not equal because element order differs",
132 reason: "equal because SortSlices sorts the slices",
139 reason: "not equal because MyInt is not the same type as int",
146 reason: "equal even when sorted with duplicate elements",
153 reason: "panics because SortSlices used with non-transitive less function",
162reason: "no panics because SortSlices used with valid less function; not equal because NaN != N…
174reason: "no panics because SortSlices used with valid less function; equal because EquateNaNs i…
188 reason: "not equal because timezones differ",
203 reason: "equal because SortMaps flattens to a slice where Time.Equal can be used",
218 reason: "not equal because MyTime is not assignable to time.Time",
221 x: map[int]string{-3: "", -2: "", -1: "", 0: "", 1: "", 2: "", 3: ""},
222 // => {0, 1, 2, 3, -1, -2, -3},
226 if -10 < a && a <= 0 {
227 a *= -100
229 if -10 < b && b <= 0 {
230 b *= -100
235 reason: "not equal because values differ even though SortMap provides valid ordering",
238 x: map[int]string{-3: "", -2: "", -1: "", 0: "", 1: "", 2: "", 3: ""},
239 // => {0, 1, 2, 3, -1, -2, -3},
244 if -10 < x && x <= 0 {
245 x *= -100
247 if -10 < y && y <= 0 {
248 y *= -100
253 if -10 < x && x <= 0 {
254 x *= -100
256 if -10 < y && y <= 0 {
257 y *= -100
263 reason: "equal because Comparer used to equate differences",
266 x: map[int]string{-3: "", -2: "", -1: "", 0: "", 1: "", 2: "", 3: ""},
272 reason: "panics because SortMaps used with non-transitive less function",
275 x: map[int]string{-3: "", -2: "", -1: "", 0: "", 1: "", 2: "", 3: ""},
281 reason: "panics because SortMaps used with partial less function",
306 reason: "no panics because EquateEmpty should compose with the sort options",
312 reason: "not equal because floats do not exactly matches",
319 reason: "not equal because EquateApprox(0 ,0) is equivalent to using ==",
326 reason: "not equal because EquateApprox is too strict",
333 reason: "equal because margin is loose enough to match",
340 reason: "equal because fraction is loose enough to match",
347 reason: "equal because both the margin and fraction are loose enough to match",
354 reason: "not equal because the types differ",
361 reason: "equal because EquateApprox also applies on float32s",
364 x: []float64{math.Inf(+1), math.Inf(-1)},
365 y: []float64{math.Inf(+1), math.Inf(-1)},
368reason: "equal because we fall back on == which matches Inf (EquateApprox does not apply on Inf…
371 x: []float64{math.Inf(+1), -1e100},
372 y: []float64{+1e100, math.Inf(-1)},
375reason: "not equal because we fall back on == where Inf != 1e100 (EquateApprox does not apply o…
379 y: float64(-1e100),
382 reason: "equal because infinite fraction matches everything",
386 y: float64(-1e100),
389 reason: "equal because infinite margin matches everything",
396 reason: "equal because EquateApprox(0, 0) is equivalent to ==",
403 reason: "not equal because EquateApprox(0, 0) is equivalent to ==",
406 x: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1)},
407 y: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1)},
409 reason: "not equal because NaN != NaN",
412 x: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1)},
413 y: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1)},
416 reason: "equal because EquateNaNs allows NaN == NaN",
419 x: []float32{1.0, float32(math.NaN()), math.E, -0.0, +0.0},
420 y: []float32{1.0, float32(math.NaN()), math.E, -0.0, +0.0},
423 reason: "equal because EquateNaNs operates on float32",
426 x: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1), 1.01, 5001},
427 y: []float64{1.0, math.NaN(), math.E, -0.0, +0.0, math.Inf(+1), math.Inf(-1), 1.02, 5002},
433 reason: "equal because EquateNaNs and EquateApprox compose together",
436 …yFloat{1.0, MyFloat(math.NaN()), MyFloat(math.E), -0.0, +0.0, MyFloat(math.Inf(+1)), MyFloat(math.…
437 …yFloat{1.0, MyFloat(math.NaN()), MyFloat(math.E), -0.0, +0.0, MyFloat(math.Inf(+1)), MyFloat(math.…
443 reason: "not equal because EquateApprox and EquateNaNs do not apply on a named type",
446 …yFloat{1.0, MyFloat(math.NaN()), MyFloat(math.E), -0.0, +0.0, MyFloat(math.Inf(+1)), MyFloat(math.…
447 …yFloat{1.0, MyFloat(math.NaN()), MyFloat(math.E), -0.0, +0.0, MyFloat(math.Inf(+1)), MyFloat(math.…
454 reason: "equal because named type is transformed to float64",
461 reason: "equal because times are identical",
468 reason: "equal because time is exactly at the allowed margin",
475 reason: "equal because time is exactly at the allowed margin (negative)",
480 opts: []cmp.Option{EquateApproxTime(3*time.Second - 1)},
482 reason: "not equal because time is outside allowed margin",
487 opts: []cmp.Option{EquateApproxTime(3*time.Second - 1)},
489 reason: "not equal because time is outside allowed margin (negative)",
496 reason: "equal because both times are zero",
503 reason: "not equal because zero time is always not equal not non-zero",
510 reason: "not equal because zero time is always not equal not non-zero",
517 reason: "time difference overflows time.Duration",
524 reason: "nil values are equal",
531 reason: "user-defined EOF is not exactly equal",
538 reason: "wrapped io.EOF is equal according to errors.Is",
544 reason: "wrapped io.EOF is not equal without EquateErrors option",
551 reason: "sentinel errors are equal",
558 reason: "AnyError is equal to any non-nil error",
564 reason: "AnyError is not equal to any non-nil error without EquateErrors option",
571 reason: "AnyError is not equal to nil value",
578 reason: "nil values are equal",
585 reason: "user-defined EOF is not exactly equal",
592 reason: "wrapped io.EOF is equal according to errors.Is",
598 reason: "wrapped io.EOF is not equal without EquateErrors option",
605 reason: "sentinel errors are equal",
612 reason: "AnyError is equal to any non-nil error",
618 reason: "AnyError is not equal to any non-nil error without EquateErrors option",
625 reason: "AnyError is not equal to nil value",
632 reason: "nil values are equal",
639 reason: "user-defined EOF is not exactly equal",
646 reason: "wrapped io.EOF is equal according to errors.Is",
652 reason: "wrapped io.EOF is not equal without EquateErrors option",
659 reason: "sentinel errors are equal",
666 reason: "AnyError is equal to any non-nil error",
672 reason: "AnyError is not equal to any non-nil error without EquateErrors option",
679 reason: "AnyError is not equal to nil value",
694 reason: "equal because all IP addresses are the same",
709 reason: "not equal because second IP address is different",
715 reason: "not equal because values do not match in deeply embedded field",
722 reason: "equal because IgnoreField ignores deeply embedded field: Alpha",
729 reason: "equal because IgnoreField ignores deeply embedded field: Foo1.Alpha",
736 reason: "equal because IgnoreField ignores deeply embedded field: Foo2.Alpha",
743 reason: "equal because IgnoreField ignores deeply embedded field: Foo3.Alpha",
750 reason: "equal because IgnoreField ignores deeply embedded field: Foo3.Foo2.Alpha",
756 reason: "not equal because many deeply nested or embedded fields differ",
763 reason: "equal because IgnoreFields ignores fields at the highest levels",
780 reason: "equal because IgnoreFields ignores fields using fully-qualified field",
796reason: "not equal because one fully-qualified field is not ignored: Bravo.Bar1.Foo3.Foo2.Foo1.…
803 reason: "not equal because highest-level field is not ignored: Foo3",
818 reason: "not equal because unexported fields mismatch",
836 reason: "equal because mismatching unexported fields are ignored",
842 reason: "not equal because 5 != 6",
849 reason: "equal because ints are ignored",
856 reason: "panics because bytes.Buffer has unexported fields",
866 reason: "equal because bytes.Buffer is ignored by match on interface type",
880 reason: "equal because bytes.Buffer is ignored by match on multiple interface types",
886 reason: "panics because sync.Mutex has unexported fields",
893 reason: "equal because IgnoreInterfaces applies on values (with pointer receiver)",
900 reason: "equal because IgnoreInterfaces applies on pointers",
904 y: ParentStruct{Public: 1, private: -2},
907 reason: "not equal because ParentStruct.private differs with AllowUnexported",
911 y: ParentStruct{Public: 1, private: -2},
914 reason: "equal because IgnoreUnexported ignored ParentStruct.private",
918 y: ParentStruct{Public: 1, private: -2, PublicStruct: &PublicStruct{Public: 3, private: 4}},
924 reason: "equal because ParentStruct.private is ignored",
928 y: ParentStruct{Public: 1, private: -2, PublicStruct: &PublicStruct{Public: 3, private: -4}},
934reason: "not equal because ParentStruct.PublicStruct.private differs and not ignored by IgnoreU…
938 y: ParentStruct{Public: 1, private: -2, PublicStruct: &PublicStruct{Public: 3, private: -4}},
943reason: "equal because both ParentStruct.PublicStruct and ParentStruct.PublicStruct.private are…
947 …y: ParentStruct{Public: 1, private: 2, privateStruct: &privateStruct{Public: -3, private: -4}},
952 reason: "not equal since ParentStruct.privateStruct differs",
956 …y: ParentStruct{Public: 1, private: 2, privateStruct: &privateStruct{Public: -3, private: -4}},
962 reason: "equal because ParentStruct.privateStruct ignored by IgnoreUnexported(ParentStruct{})",
966 y: ParentStruct{Public: 1, private: 2, privateStruct: &privateStruct{Public: 3, private: -4}},
972 reason: "equal because privateStruct.private ignored by IgnoreUnexported(privateStruct{})",
976 …y: ParentStruct{Public: 1, private: 2, privateStruct: &privateStruct{Public: -3, private: -4}},
982reason: "not equal because privateStruct.Public differs and not ignored by IgnoreUnexported(pri…
995 MyInt: -5,
1000 Public: 1, private: -2, PublicStruct: &PublicStruct{Public: -3, private: -4},
1010 reason: "equal because all Ignore options can be composed together",
1019 reason: "equal because zero elements are ignored",
1028 reason: "not equal because MyInt is not assignable to int",
1037 reason: "equal because the element type of MyInts is assignable to int",
1047 reason: "not equal because ignored elements does not imply empty slice",
1056 reason: "equal because uppercase keys are ignored",
1065 reason: "not equal because MyString is not assignable to string",
1074 reason: "not equal because MyInt is not assignable to int",
1084 reason: "not equal because ignored entries does not imply empty map",
1093 reason: "not equal because 3rd line differs, but should not recurse infinitely",
1102reason: "equal because of strings.ToUpper; AcyclicTransformer unnecessary, but check this still…
1111 reason: "equal because acyclic transformer splits on any contiguous whitespace",
1127 case tt.reason == "":
1128 t.Errorf("reason must be provided")
1130 t.Errorf("expected Equal panic\nreason: %s", tt.reason)
1132 t.Errorf("unexpected Equal panic: got %v\nreason: %v", gotPanic, tt.reason)
1134 t.Errorf("Equal = %v, want %v\nreason: %v", gotEqual, tt.wantEqual, tt.reason)
1147 reason string // The reason for the expected outcome
1152 reason: "zero margin and fraction is equivalent to exact equality",
1156 args: args(-0.1, 0.0),
1157 wantPanic: "margin or fraction must be a non-negative number",
1158 reason: "negative inputs are invalid",
1162 args: args(0.0, -0.1),
1163 wantPanic: "margin or fraction must be a non-negative number",
1164 reason: "negative inputs are invalid",
1169 wantPanic: "margin or fraction must be a non-negative number",
1170 reason: "NaN inputs are invalid",
1175 reason: "fraction of 1.0 or greater is valid",
1180 reason: "margin of infinity is valid",
1184 args: args(time.Duration(-1)),
1185 wantPanic: "margin must be a non-negative number",
1186 reason: "negative duration is invalid",
1192 reason: "func(x, y string) int is wrong signature for less",
1198 reason: "nil value is not valid",
1204 reason: "func(x, y string) int is wrong signature for less",
1210 reason: "nil value is not valid",
1216 reason: "empty selector is invalid",
1222 reason: "single dot selector is invalid",
1227 reason: "dot-prefix is okay since Foo1.Alpha reads naturally",
1233 reason: "dot-suffix is invalid",
1239 reason: "identifiers must not have spaces",
1245 reason: "name of non-existent field is invalid",
1251 reason: "cannot select into a non-struct",
1256 wantPanic: "must be a non-pointer struct",
1257 reason: "the type must be a struct (not pointer to a struct)",
1262 reason: "privateStruct field permitted since it is the default name of the embedded type",
1267 reason: "Public field permitted since it is a forwarded field that is exported",
1273 reason: "private field not permitted since it is a forwarded field that is unexported",
1277 reason: "empty input is valid",
1283 reason: "input must not be nil value",
1288 reason: "duplicate inputs of the same type is valid",
1294 reason: "input must not be nil value",
1300 reason: "input must not be a named struct type",
1306 reason: "input must not have named fields",
1312 reason: "field types must be interfaces",
1318 reason: "field types must not be the empty interface",
1328 reason: "multiple interfaces may be specified, even if they overlap",
1332 reason: "empty input is valid",
1337 wantPanic: "must be a non-pointer struct",
1338 reason: "input must not be nil value",
1343 wantPanic: "must be a non-pointer struct",
1344 reason: "input must be a struct type (not a pointer to a struct)",
1349 reason: "input may be named or unnamed structs",
1355 reason: "AcyclicTransformer has same input requirements as Transformer",
1366 if i == tf.NumIn()-1 && tf.IsVariadic() {
1392 case tt.reason == "":
1393 t.Errorf("reason must be provided")
1395 t.Errorf("unexpected panic message: %s\nreason: %s", gotPanic, tt.reason)
1397 t.Errorf("panic message:\ngot: %s\nwant: %s\nreason: %s", gotPanic, tt.wantPanic, tt.reason)