diff --git a/omglol/web_test.go b/omglol/web_test.go index c7c80e7..c2aadb2 100644 --- a/omglol/web_test.go +++ b/omglol/web_test.go @@ -16,6 +16,12 @@ func TestGetSetRestoreWeb(t *testing.T) { t.Errorf(err.Error()) } + if w != nil { + t.Logf("Previous content: %s", w.Content) + } else { + t.Logf("Previous content was empty.") + } + previousContent := w.Content newContent := "this is the new content\n\nit has newlines\n" @@ -33,12 +39,18 @@ func TestGetSetRestoreWeb(t *testing.T) { if err != nil { t.Errorf(err.Error()) } - if w.Content != newContent { - t.Errorf("Expected content '%s', got '%s'", newContent, w.Content) - } - if string(w.ContentBytes) != newContent { - t.Errorf("Expected ContentBytes '%s', got '%s'", newContent, string(w.Content)) - } + + if w != nil { + t.Logf("New content: %s", w.Content) + if w.Content != newContent { + t.Errorf("Expected content '%s', got '%s'", newContent, w.Content) + } + if string(w.ContentBytes) != newContent { + t.Errorf("Expected ContentBytes '%s', got '%s'", newContent, string(w.Content)) + } + } else { + t.Errorf("GetWeb returned 'nil'.") + } sleep() published, err = c.SetWeb(testOwnedDomain, []byte(previousContent), true)