Debian Codegraph @

test_cases/filtered.test.go

raw symbols SCIP
1 // Copyright 2011 Aaron Jacobs. All Rights Reserved.
2 // Author: [email protected] (Aaron Jacobs)
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15
16 package oglematchers_test
17
18 import (
19 "fmt"
20 . "github.com/jacobsa/oglematchers"
21 . "github.com/jacobsa/ogletest"
22 "testing"
23 )
24
25 func TestFiltered(t *testing.T) { RunTests(t) }
26
27 ////////////////////////////////////////////////////////////////////////
28 // Partially filtered out
29 ////////////////////////////////////////////////////////////////////////
30
31 type PartiallyFilteredTest struct {
32 }
33
34 func init() { RegisterTestSuite(&PartiallyFilteredTest{}) }
35
36 func (t *PartiallyFilteredTest) PassingTestFoo() {
37 ExpectThat(19, Equals(19))
38 }
39
40 func (t *PartiallyFilteredTest) PassingTestBar() {
41 ExpectThat(17, Equals(17))
42 }
43
44 func (t *PartiallyFilteredTest) PartiallyFilteredTestFoo() {
45 ExpectThat(18, LessThan(17))
46 }
47
48 func (t *PartiallyFilteredTest) PartiallyFilteredTestBar() {
49 ExpectThat("taco", HasSubstr("blah"))
50 }
51
52 func (t *PartiallyFilteredTest) PartiallyFilteredTestBaz() {
53 ExpectThat(18, LessThan(17))
54 }
55
56 ////////////////////////////////////////////////////////////////////////
57 // Completely filtered out
58 ////////////////////////////////////////////////////////////////////////
59
60 type CompletelyFilteredTest struct {
61 }
62
63 func init() { RegisterTestSuite(&CompletelyFilteredTest{}) }
64
65 func (t *CompletelyFilteredTest) SetUpTestSuite() {
66 fmt.Println("SetUpTestSuite run!")
67 }
68
69 func (t *CompletelyFilteredTest) TearDownTestSuite() {
70 fmt.Println("TearDownTestSuite run!")
71 }
72
73 func (t *PartiallyFilteredTest) SomePassingTest() {
74 ExpectThat(19, Equals(19))
75 }
76
77 func (t *PartiallyFilteredTest) SomeFailingTest() {
78 ExpectThat(19, Equals(17))
79 }