latest-api_test.go (262B)
1 package xkcd 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func Test(t *testing.T) { 9 received := latestAPI() 10 expected := "https://xkcd.com/info.0.json" 11 if received != expected { 12 msg := fmt.Sprintf("Expected `%s', received `%s'.\n", expected, received) 13 t.Error(msg) 14 } 15 }