Approval-based snapshot testing library for Go (mirror)
at main 78 lines 1.8 kB view raw
1--- 2title: Complex Nested Structure 3test_name: TestComplexNestedStructure 4file_name: shutter_test.go 5version: 0.1.0 6--- 7shutter_test.Post{ 8 ID: 100, 9 Title: "Introduction to Go Snapshot Testing", 10 Content: "This is a comprehensive guide to snapshot testing in Go...", 11 Author: shutter_test.User{ 12 ID: 1, 13 Username: "john_doe", 14 Email: "john@example.com", 15 Active: true, 16 CreatedAt: time.Time{ 17 wall: 0x0, 18 ext: 63809375400, 19 loc: (*time.Location)(nil), 20 }, 21 Roles: []string{"admin", "moderator", "user"}, 22 Metadata: map[string]interface{}{ 23 "language": "en", 24 "notifications": true, 25 "preferences": map[string]interface{}{ 26 "email_frequency": "weekly", 27 "notifications": true, 28 }, 29 "theme": "dark", 30 }, 31 }, 32 Tags: []string{"go", "testing", "snapshots", "best-practices"}, 33 Comments: []shutter_test.Comment{ 34 { 35 ID: 1, 36 Author: "alice", 37 Content: "Great post!", 38 CreatedAt: time.Time{ 39 wall: 0x0, 40 ext: 63810858120, 41 loc: (*time.Location)(nil), 42 }, 43 Replies: []shutter_test.Comment{ 44 { 45 ID: 2, 46 Author: "bob", 47 Content: "I agree!", 48 CreatedAt: time.Time{ 49 wall: 0x0, 50 ext: 63810863100, 51 loc: (*time.Location)(nil), 52 }, 53 Replies: []shutter_test.Comment{ 54 }, 55 }, 56 }, 57 }, 58 { 59 ID: 3, 60 Author: "charlie", 61 Content: "Thanks for sharing!", 62 CreatedAt: time.Time{ 63 wall: 0x0, 64 ext: 63810927000, 65 loc: (*time.Location)(nil), 66 }, 67 Replies: []shutter_test.Comment{ 68 }, 69 }, 70 }, 71 Likes: 42, 72 Published: true, 73 CreatedAt: time.Time{ 74 wall: 0x0, 75 ext: 63809802000, 76 loc: (*time.Location)(nil), 77 }, 78}