xkcd-go

Golang tool to read latest, random, or a specific xkcd comic (and download it too).
git clone http://git.hanabi.in/repos/xkcd-go.git
Log | Files | Refs | README | LICENSE

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 }