From 173307660dd80bcd88e51268ae247779a9ff1ea1 Mon Sep 17 00:00:00 2001 From: Steven Degutis Date: Fri, 16 Mar 2012 07:20:08 -0500 Subject: [PATCH] files --- about_files.go | 11 +++++++++++ setup_koans_test.go | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 about_files.go diff --git a/about_files.go b/about_files.go new file mode 100644 index 0000000..539d84f --- /dev/null +++ b/about_files.go @@ -0,0 +1,11 @@ +package go_koans + +import "io/ioutil" +import "strings" + +func testFiles() { + filename := "about_files.go" + contents, _ := ioutil.ReadFile(filename) + lines := strings.Split(string(contents), "\n") + assert(lines[5] == __string__) // handling files is too trivial +} diff --git a/setup_koans_test.go b/setup_koans_test.go index cec612f..328c5af 100644 --- a/setup_koans_test.go +++ b/setup_koans_test.go @@ -24,10 +24,10 @@ func TestKoans(t *testing.T) { //testControlFlow() //testEnumeration() //testAnonymousFunctions() - testVariadicFunctions() + //testVariadicFunctions() + testFiles() // TODO: ie, gameplan - //testFiles() //testInterfaces() //testMaps() //testStructs()