| 1 | // Copyright (c) 2023, Maxime Soulé |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // This source code is licensed under the BSD-style license found in the |
| 5 | // LICENSE file in the root directory of this source tree. |
| 6 | |
| 7 | //go:build go1.18 |
| 8 | // +build go1.18 |
| 9 | |
| 10 | package td_testscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td_test`/ |
| 11 | |
| 12 | import ( |
| 13 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 14 | "timescip-go gomod github.com/golang/go/src go1.18 time/" |
| 15 | |
| 16 | "github.com/maxatome/go-testdeep/internal/testscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/internal/test`/" |
| 17 | "github.com/maxatome/go-testdeep/tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/" |
| 18 | ) |
| 19 | |
| 20 | func TestAnchorscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td_test`/TestAnchor().(tt *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 21 | ttt := testscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/internal/test`/.NewTestingTBscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/internal/test`/NewTestingTB().(tt.Namescip-go gomod github.com/golang/go/src go1.18 testing/common#Name().()) |
| 22 | t := tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.NewTscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/NewT().(ttt) |
| 23 | type MyStruct struct { |
| 24 | PNum *int |
| 25 | Num int64 |
| 26 | Str string |
| 27 | Slice []int |
| 28 | Map map[string]bool |
| 29 | Time timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time# |
| 30 | } |
| 31 | n := 42 |
| 32 | got := MyStruct{ |
| 33 | PNum: &n, |
| 34 | Num: 136, |
| 35 | Str: "Pipo bingo", |
| 36 | Time: timeParsescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td_test`/timeParse().(tt, "2019-01-02T11:22:33.123456Z"), |
| 37 | } |
| 38 | |
| 39 | tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.CmpTruescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/CmpTrue().(tt, |
| 40 | t.Cmpscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/T#Cmp().(got, MyStruct{ |
| 41 | PNum: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Anchorscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Anchor().[*int](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ptrscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Ptr().(tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Betweenscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Between().(40, 45))), |
| 42 | Num: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Anchorscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Anchor().[int64](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Betweenscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Between().(int64(135), int64(137))), |
| 43 | Str: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Anchorscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Anchor().[string](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.HasPrefixscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/HasPrefix().("Pipo")), |
| 44 | Time: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Anchorscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Anchor().[timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time#](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.TruncTimescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/TruncTime().(timeParsescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td_test`/timeParse().(tt, "2019-01-02T11:22:00Z"), timescip-go gomod github.com/golang/go/src go1.18 time/.Minutescip-go gomod github.com/golang/go/src go1.18 time/Minute.)), |
| 45 | })) |
| 46 | |
| 47 | tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.CmpTruescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/CmpTrue().(tt, |
| 48 | t.Cmpscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/T#Cmp().(got, MyStruct{ |
| 49 | PNum: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ascip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/A().[*int](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ptrscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Ptr().(tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Betweenscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Between().(40, 45))), |
| 50 | Num: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ascip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/A().[int64](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Betweenscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/Between().(int64(135), int64(137))), |
| 51 | Str: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ascip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/A().[string](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.HasPrefixscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/HasPrefix().("Pipo")), |
| 52 | Time: tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.Ascip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/A().[timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time#](t, tdscip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/.TruncTimescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td`/TruncTime().(timeParsescip-go gomod github.com/maxatome/go-testdeep . `github.com/maxatome/go-testdeep/td_test`/timeParse().(tt, "2019-01-02T11:22:00Z"), timescip-go gomod github.com/golang/go/src go1.18 time/.Minutescip-go gomod github.com/golang/go/src go1.18 time/Minute.)), |
| 53 | })) |
| 54 | } |