File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ package notmuch
2
+
3
+ // Copyright © 2015 The go.notmuch Authors. Authors can be found in the AUTHORS file.
4
+ // Licensed under the GPLv3 or later.
5
+ // See COPYING at the root of the repository for details.
6
+
7
+ // This file contains tests that exercise the resource creation/reclamation model.
8
+
9
+ import (
10
+ "testing"
11
+ )
12
+
13
+ // Basic test of the case where the user explicitly closes a parent object
14
+ // before the child object. This is inevitable if Close is used at all; the
15
+ // GC will close things child-first.
16
+ func TestOutOfOrderClose (t * testing.T ) {
17
+ db , err := Open (dbPath , DBReadOnly )
18
+ if err != nil {
19
+ t .Fatalf ("Open(%q): unexpected error: %s" , dbPath , err )
20
+ }
21
+
22
+ query := db .NewQuery ("subject:\" Introducing myself\" " )
23
+ threads , err := query .Threads ()
24
+ if err != nil {
25
+ t .Fatalf ("error getting the threads: %s" , err )
26
+ }
27
+
28
+ db .Close ()
29
+ threads .Close ()
30
+ }
You can’t perform that action at this time.
0 commit comments