From f7a9437dec37530db934deb0c70c713032781c15 Mon Sep 17 00:00:00 2001 From: Steven Degutis Date: Mon, 26 Mar 2012 18:25:04 -0500 Subject: [PATCH] adding more basics, renaming them to basics --- about_basics.go | 31 +++++++++++++++++++++++++++++++ about_numbers.go | 13 ------------- setup_koans_test.go | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 about_basics.go delete mode 100644 about_numbers.go diff --git a/about_basics.go b/about_basics.go new file mode 100644 index 0000000..8055460 --- /dev/null +++ b/about_basics.go @@ -0,0 +1,31 @@ +package go_koans + +func aboutBasics() { + assert(__bool__ == true) // what is truth? + assert(__bool__ != false) // in it there is nothing false + + var i int = __int__ + assert(i == 1.0000000000000000000000000000000000000) // precision is in the eye of the beholder + + assert(5 % 2 == __int__) + assert(5 * 2 == __int__) + assert(5 ^ 2 == __int__) + + var x int + assert(x == __int__) // zero values are valued in Go + + var f float32 + assert(f == __float32__) // for types of all types + + var s string + assert(s == __string__) // both typical or atypical types + + var c struct { + x int + f float32 + s string + } + assert(c.x == __int__) // and types within composite types + assert(c.f == __float32__) // which match the other types + assert(c.s == __string__) // in a typical way +} diff --git a/about_numbers.go b/about_numbers.go deleted file mode 100644 index 0b2e0ee..0000000 --- a/about_numbers.go +++ /dev/null @@ -1,13 +0,0 @@ -package go_koans - -func aboutNumbers() { - assert(__bool__ == true) // what is truth? - assert(__bool__ != false) // in it there is nothing false - - var i int = __int__ - assert(i == 1.0000000000000000000000000000000000000) // precision is in the eye of the beholder - - assert(5 % 2 == __int__) - assert(5 * 2 == __int__) - assert(5 ^ 2 == __int__) -} diff --git a/setup_koans_test.go b/setup_koans_test.go index 461aa2d..498a716 100644 --- a/setup_koans_test.go +++ b/setup_koans_test.go @@ -21,7 +21,7 @@ const ( var __runner__ runner = nil func TestKoans(t *testing.T) { - aboutNumbers() + aboutBasics() aboutStrings() aboutArrays() aboutSlices()