Closed dezren39 closed 1 year ago
Could you try setting logger.SetColorProfile(termenv.TrueColor)
in the tests?
this produced the same effect. 😞
it's odd because the 'expected' shows up fully rendered in color and the log module works fine when i'm actually using it.
seems like something about the test setup but i'm unsure what it could be.
--- FAIL: TestTextValueStyles/map_of_strings (0.00s)
text_test.go:399:
Error Trace: C:/git/log/text_test.go:399
Error: Not equal:
expected: "\x1b[1;38;5;204mERRO\x1b[0m info \x1b[2mkey1\x1b[0m\x1b[2m=\x1b[0m\x1b[1m\"map[baz:qux foo:bar]\"\x1b[0m\n"
actual : "ERRO info key1=\"map[baz:qux foo:bar]\"\n"
Diff:
--- Expected
+++ Actual
@@ -1,2 +1,2 @@
-ERRO info key1="map[baz:qux foo:bar]"
+ERRO info key1="map[baz:qux foo:bar]"
Test: TestTextValueStyles/map_of_strings
FAIL
exit status 1
FAIL github.com/charmbracelet/log 0.383s
PS C:/git/log> git diff
diff --git a/text_test.go b/text_test.go
index 75c4bfc..3da6786 100644
--- a/text_test.go
+++ b/text_test.go
@@ -94,6 +94,8 @@ func TestTextCaller(t *testing.T) {
func TestTextLogger(t *testing.T) {
var buf bytes.Buffer
logger := New(&buf)
+ logger.SetColorProfile(termenv.TrueColor)
+
cases := []struct {
name string
expected string
PS C:/git/log>
func TestTextLogger(t *testing.T) {
var buf bytes.Buffer
logger := New(&buf)
logger.SetColorProfile(termenv.TrueColor)
cases := []struct {
oh nevermind i used the wrong test to update, tried again and that change worked. i will make a pr with this change, not sure if it's needed or a sign of a different issue, but will link to this once created.
oh nevermind i used the wrong test to update, tried again and that change worked. i will make a pr with this change, not sure if it's needed or a sign of a different issue, but will link to this once created.
Thank you for confirming. This should be fixed in #84 🙂
hello, i was working on a pr and noticed that these tests fail for me. i checked the github actions and the tests are green there. i've had this using windows and the vs code terminal, with powershell, pwsh, and cmd. i also had this issue with latest clean ubuntu wsl image from the store.