whisper: fix gosimple

This commit is contained in:
b00ris 2018-01-11 15:14:12 +03:00
parent faa510618e
commit dfffdb8685
No known key found for this signature in database
GPG key ID: 2F73E159EB73232C
2 changed files with 16 additions and 8 deletions

View file

@ -813,7 +813,8 @@ func TestVariableTopics(t *testing.T) {
func TestMatchSingleTopic_ReturnTrue(t *testing.T) { func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
bt := []byte("test") bt := []byte("test")
topic := BytesToTopic(bt) topic := BytesToTopic(bt)
if matchSingleTopic(topic, bt) == false {
if !matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -821,7 +822,8 @@ func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) { func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
bt := []byte("test with tail") bt := []byte("test with tail")
topic := BytesToTopic([]byte("test")) topic := BytesToTopic([]byte("test"))
if matchSingleTopic(topic, bt) == false {
if !matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -829,7 +831,8 @@ func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) { func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
bt := []byte("tes") bt := []byte("tes")
topic := BytesToTopic(bt) topic := BytesToTopic(bt)
if matchSingleTopic(topic, bt) == true {
if matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -837,7 +840,8 @@ func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) { func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) {
bt := []byte("test") bt := []byte("test")
topic := BytesToTopic([]byte("not_equal")) topic := BytesToTopic([]byte("not_equal"))
if matchSingleTopic(topic, bt) == true {
if matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }

View file

@ -837,7 +837,8 @@ func TestVariableTopics(t *testing.T) {
func TestMatchSingleTopic_ReturnTrue(t *testing.T) { func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
bt := []byte("test") bt := []byte("test")
topic := BytesToTopic(bt) topic := BytesToTopic(bt)
if matchSingleTopic(topic, bt) == false {
if !matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -845,7 +846,8 @@ func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) { func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
bt := []byte("test with tail") bt := []byte("test with tail")
topic := BytesToTopic([]byte("test")) topic := BytesToTopic([]byte("test"))
if matchSingleTopic(topic, bt) == false {
if !matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -853,7 +855,8 @@ func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) { func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
bt := []byte("tes") bt := []byte("tes")
topic := BytesToTopic(bt) topic := BytesToTopic(bt)
if matchSingleTopic(topic, bt) == true {
if matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }
@ -861,7 +864,8 @@ func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) { func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) {
bt := []byte("test") bt := []byte("test")
topic := BytesToTopic([]byte("not_equal")) topic := BytesToTopic([]byte("not_equal"))
if matchSingleTopic(topic, bt) == true {
if matchSingleTopic(topic, bt) {
t.FailNow() t.FailNow()
} }
} }