Approval-based snapshot testing library for Go (mirror)
at main 76 lines 1.7 kB view raw
1--- 2title: Structure with Interface Fields 3test_name: TestStructureWithInterface 4file_name: shutter_test.go 5version: 0.1.0 6--- 7[]shutter_test.Response{ 8 { 9 Status: "success", 10 Message: "User retrieved", 11 Data: shutter_test.User{ 12 ID: 1, 13 Username: "john", 14 Email: "john@example.com", 15 Active: true, 16 CreatedAt: time.Time{ 17 wall: 0x0, 18 ext: 0, 19 loc: (*time.Location)(nil), 20 }, 21 Roles: []string(nil), 22 Metadata: map[string]interface{}(nil), 23 }, 24 Meta: map[string]interface{}{ 25 "request_id": "req-123", 26 "timestamp": "2023-01-20T10:30:00Z", 27 }, 28 }, 29 { 30 Status: "error", 31 Message: "User not found", 32 Data: nil, 33 Meta: map[string]interface{}{ 34 "error_code": 404, 35 "error_type": "NOT_FOUND", 36 }, 37 }, 38 { 39 Status: "success", 40 Message: "Posts retrieved", 41 Data: []shutter_test.Post{ 42 { 43 ID: 1, 44 Title: "First Post", 45 Content: "", 46 Author: shutter_test.User{ 47 ID: 0, 48 Username: "", 49 Email: "", 50 Active: false, 51 CreatedAt: time.Time{ 52 wall: 0x0, 53 ext: 0, 54 loc: (*time.Location)(nil), 55 }, 56 Roles: []string(nil), 57 Metadata: map[string]interface{}(nil), 58 }, 59 Tags: []string(nil), 60 Comments: []shutter_test.Comment(nil), 61 Likes: 0, 62 Published: true, 63 CreatedAt: time.Time{ 64 wall: 0x0, 65 ext: 0, 66 loc: (*time.Location)(nil), 67 }, 68 }, 69 }, 70 Meta: map[string]interface{}{ 71 "page": 1, 72 "per_page": 20, 73 "total_count": 10, 74 }, 75 }, 76}