Commit 8c9aafd4 authored by gwenn's avatar gwenn

Fix backup test and doc.

parent 560595ad
...@@ -22,8 +22,10 @@ import ( ...@@ -22,8 +22,10 @@ import (
// // check err // // check err
// cbs := make(chan sqlite.BackupStatus) // cbs := make(chan sqlite.BackupStatus)
// go func() { // go func() {
// s := <- cbs // for {
// // report progress // s := <- cbs
// // report progress
// }
// }() // }()
// err = bck.Run(100, 250000, cbs) // err = bck.Run(100, 250000, cbs)
// check(err) // check(err)
......
...@@ -17,9 +17,11 @@ func TestBackup(t *testing.T) { ...@@ -17,9 +17,11 @@ func TestBackup(t *testing.T) {
cbs := make(chan BackupStatus) cbs := make(chan BackupStatus)
go func() { go func() {
s := <- cbs for {
t.Logf("Backup progress %#v\n", s) s := <- cbs
t.Logf("Backup progress %#v\n", s)
}
}() }()
err = bck.Run(100, 0, cbs) err = bck.Run(10, 0, cbs)
checkNoError(t, err, "couldn't do backup: %#v") checkNoError(t, err, "couldn't do backup: %#v")
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment