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