mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
Improve TestClose
This commit is contained in:
parent
513100bb92
commit
168b23556a
@ -174,23 +174,23 @@ func TestClose(t *testing.T) {
|
|||||||
|
|
||||||
c0.close(nil)
|
c0.close(nil)
|
||||||
|
|
||||||
ok := c0.isClosed()
|
if !c0.isClosed() {
|
||||||
if !ok {
|
t.Fatal("Connection should be closed")
|
||||||
|
}
|
||||||
|
if !m0.isClosed() {
|
||||||
t.Fatal("Connection should be closed")
|
t.Fatal("Connection should be closed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// None of these should panic, some should return an error
|
// None of these should panic, some should return an error
|
||||||
|
|
||||||
ok = c0.ping()
|
if c0.ping() {
|
||||||
if ok {
|
|
||||||
t.Error("Ping should not return true")
|
t.Error("Ping should not return true")
|
||||||
}
|
}
|
||||||
|
|
||||||
c0.Index("default", nil)
|
c0.Index("default", nil)
|
||||||
c0.Index("default", nil)
|
c0.Index("default", nil)
|
||||||
|
|
||||||
_, err := c0.Request("default", "foo", 0, 0)
|
if _, err := c0.Request("default", "foo", 0, 0); err == nil {
|
||||||
if err == nil {
|
|
||||||
t.Error("Request should return an error")
|
t.Error("Request should return an error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user