(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func TestSingleModuleKey(t *testing.T) { |
| 114 | buf := &bytes.Buffer{} |
| 115 | New(buf, mustConfig(t, "info", "json", false, "off", false)). |
| 116 | With("module", "a", "k", "v"). |
| 117 | With("module", "b"). |
| 118 | Info("m") |
| 119 | |
| 120 | require.Equal(t, 1, strings.Count(buf.String(), `"module"`), buf.String()) |
| 121 | lines := jsonLines(t, buf) |
| 122 | require.Equal(t, "b", lines[0]["module"]) |
| 123 | require.Equal(t, "v", lines[0]["k"]) |
| 124 | } |
| 125 | |
| 126 | func TestModuleFilterBeforeEncoding(t *testing.T) { |
| 127 | buf := &bytes.Buffer{} |