ethwire: fix ClientIdentity test
This commit is contained in:
parent
56014844a9
commit
38034c3066
@ -9,22 +9,22 @@ import (
|
|||||||
func TestClientIdentity(t *testing.T) {
|
func TestClientIdentity(t *testing.T) {
|
||||||
clientIdentity := NewSimpleClientIdentity("Ethereum(G)", "0.5.16", "test")
|
clientIdentity := NewSimpleClientIdentity("Ethereum(G)", "0.5.16", "test")
|
||||||
clientString := clientIdentity.String()
|
clientString := clientIdentity.String()
|
||||||
expected := fmt.Sprintf("Ethereum(G)/v0.5.16/test/%s/Go", runtime.GOOS)
|
expected := fmt.Sprintf("Ethereum(G)/v0.5.16/test/%s/%s", runtime.GOOS, runtime.Version())
|
||||||
if clientString != expected {
|
if clientString != expected {
|
||||||
t.Error("Expected clientIdentity to be %v, got %v", expected, clientString)
|
t.Errorf("Expected clientIdentity to be %q, got %q", expected, clientString)
|
||||||
}
|
}
|
||||||
customIdentifier := clientIdentity.GetCustomIdentifier()
|
customIdentifier := clientIdentity.GetCustomIdentifier()
|
||||||
if customIdentifier != "test" {
|
if customIdentifier != "test" {
|
||||||
t.Error("Expected clientIdentity.GetCustomIdentifier() to be 'test', got %v", customIdentifier)
|
t.Errorf("Expected clientIdentity.GetCustomIdentifier() to be 'test', got %q", customIdentifier)
|
||||||
}
|
}
|
||||||
clientIdentity.SetCustomIdentifier("test2")
|
clientIdentity.SetCustomIdentifier("test2")
|
||||||
customIdentifier = clientIdentity.GetCustomIdentifier()
|
customIdentifier = clientIdentity.GetCustomIdentifier()
|
||||||
if customIdentifier != "test2" {
|
if customIdentifier != "test2" {
|
||||||
t.Error("Expected clientIdentity.GetCustomIdentifier() to be 'test2', got %v", customIdentifier)
|
t.Errorf("Expected clientIdentity.GetCustomIdentifier() to be 'test2', got %q", customIdentifier)
|
||||||
}
|
}
|
||||||
clientString = clientIdentity.String()
|
clientString = clientIdentity.String()
|
||||||
expected = fmt.Sprintf("Ethereum(G)/v0.5.16/test2/%s/Go", runtime.GOOS)
|
expected = fmt.Sprintf("Ethereum(G)/v0.5.16/test2/%s/%s", runtime.GOOS, runtime.Version())
|
||||||
if clientString != expected {
|
if clientString != expected {
|
||||||
t.Error("Expected clientIdentity to be %v, got %v", expected, clientString)
|
t.Errorf("Expected clientIdentity to be %q, got %q", expected, clientString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user