I have an interface in package “foo”. The compiler is making sure my
struct in package “bar” implements the interface, but I’d also like to have
a standard set of test code in “foo” can that be used by any implementer to
more fully test the behavior of functions. The test code would live in
“foo”, but would be called by tests is “bar” (or “baz”, next
implementation, ...). I can’t seem to do this if the standard tests in
“foo” are in files named "_test.go". Other file naming schemes do work,
but I wondered if there was some way for this code to live in normal
"_test.go" files while still being importable by another package’s tests.

Or... maybe this interface testing approach is more generally flawed?



You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupgolang-nuts @
postedDec 1, '15 at 6:51p
activeDec 10, '15 at 4:00p

2 users in discussion

Kalafut: 2 posts Chris Kastorff: 1 post



site design / logo © 2022 Grokbase