PHONG B NGUYEN

67%
Flag icon
It is an external test, and thus it cannot access isSpace directly, so fmt opens a back door to it by declaring an exported variable that holds the internal isSpace function. This is the entirety of the fmt package’s export_test.go file. package fmt var IsSpace = isSpace This test file defines no tests; it just declares the exported symbol fmt.IsSpace for use by the external test. This trick can also be used whenever an external test needs to use some of the techniques of white-box testing.
The Go Programming Language
Rate this book
Clear rating
Open Preview