@@ -10,8 +10,8 @@ import (
1010 ex "github.com/goinaction/code/chapter9/listing04"
1111)
1212
13- const succeed = "\u2713 "
14- const failed = "\u2717 "
13+ const checkMark = "\u2713 "
14+ const ballotX = "\u2717 "
1515
1616func init () {
1717 ex .Routes ()
@@ -26,29 +26,29 @@ func TestSendJSON(t *testing.T) {
2626 http .DefaultServeMux .ServeHTTP (w , r )
2727
2828 if w .Code != 200 {
29- t .Fatalf ("\t Should received a status code of 200 for the response. Received[%d] %s" , w .Code , failed )
29+ t .Fatalf ("\t Should received a status code of 200 for the response. Received[%d] %s" , w .Code , ballotX )
3030 }
31- t .Log ("\t Should received a status code of 200 for the response." , succeed )
31+ t .Log ("\t Should received a status code of 200 for the response." , checkMark )
3232
3333 u := struct {
3434 Name string
3535 Email string
3636 }{}
3737 if err := json .NewDecoder (w .Body ).Decode (& u ); err != nil {
38- t .Fatal ("\t Should be able to unmarshal the response." , failed )
38+ t .Fatal ("\t Should be able to unmarshal the response." , ballotX )
3939 }
40- t .Log ("\t Should be able to unmarshal the response." , succeed )
40+ t .Log ("\t Should be able to unmarshal the response." , checkMark )
4141
4242 if u .Name == "Bill" {
43- t .Log ("\t Should have \" Bill\" for Name in the response." , succeed )
43+ t .Log ("\t Should have \" Bill\" for Name in the response." , checkMark )
4444 } else {
45- t .Error ("\t Should have \" Bill\" for Name in the response." , failed , u .Name )
45+ t .Error ("\t Should have \" Bill\" for Name in the response." , ballotX , u .Name )
4646 }
4747
4848 if u .Email == "bill@ardanstudios.com" {
49- t .Log ("\t Should have \" bill@ardanstudios.com\" for Email in the response." , succeed )
49+ t .Log ("\t Should have \" bill@ardanstudios.com\" for Email in the response." , checkMark )
5050 } else {
51- t .Error ("\t Should have \" bill@ardanstudios.com\" for Email in the response." , failed , u .Email )
51+ t .Error ("\t Should have \" bill@ardanstudios.com\" for Email in the response." , ballotX , u .Email )
5252 }
5353 }
5454}
0 commit comments