Created
September 24, 2012 14:13
-
-
Save bluesalt/3776150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
. "launchpad.net/gocheck" | |
"testing" | |
) | |
func Test(t *testing.T) { | |
TestingT(t) | |
} | |
type MySuite struct{} | |
var _ = Suite(&MySuite{}) | |
type IFoobar interface { | |
foobar() | |
} | |
type Foobar struct { | |
} | |
func (f *Foobar) foobar() { | |
} | |
func (s *MySuite) TestFoobar(c *C) { | |
v := Foobar{} | |
var i interface{} = v | |
_, ok := i.(IFoobar) | |
c.Assert(ok, Equals, false) | |
var p interface{} = &v | |
_, ok = p.(IFoobar) | |
c.Assert(ok, Equals, true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment