()
| 101 | } |
| 102 | |
| 103 | func (s *FormatterPrettyTestSuite) TestAttributes() { |
| 104 | s.logger().Info( |
| 105 | "Test message", |
| 106 | slog.String("string", "value"), |
| 107 | slog.Int("int", -100), |
| 108 | slog.Uint64("uint64", 200), |
| 109 | slog.Float64("float64", 3.14), |
| 110 | slog.Bool("bool", true), |
| 111 | slog.Time("time", time.Date(1984, 1, 2, 3, 4, 5, 6, time.UTC)), |
| 112 | slog.Duration("duration", time.Minute), |
| 113 | slog.Any("err", errors.New("error value")), |
| 114 | slog.Any("any", struct { |
| 115 | Field1 string |
| 116 | Field2 int |
| 117 | }{"value", 42}), |
| 118 | ) |
| 119 | |
| 120 | s.checkNextEntry( |
| 121 | "INF", |
| 122 | strings.Join([]string{ |
| 123 | "Test message", |
| 124 | "string=value", |
| 125 | "int=-100", |
| 126 | "uint64=200", |
| 127 | "float64=3.14", |
| 128 | "bool=true", |
| 129 | `time="1984-01-02 03:04:05"`, |
| 130 | "duration=1m0s", |
| 131 | `err="error value"`, |
| 132 | `any="{Field1:value Field2:42}"`, |
| 133 | }, " "), |
| 134 | ) |
| 135 | } |
| 136 | |
| 137 | func (s *FormatterPrettyTestSuite) TestGroups() { |
| 138 | s.Run("LastGroupNotEmpty", func() { |
nothing calls this directly
no test coverage detected