aboutsummaryrefslogtreecommitdiffstats
path: root/exercises/if/if1/main_test.go
diff options
context:
space:
mode:
authorMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-11-13 08:56:59 -0300
committerMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-11-13 08:56:59 -0300
commit8d1a3f64dc1e491d0d5e79f3e4d176699e637dd4 (patch)
tree1b8dd84447ef17863f60f3a6bd113d68d716120d /exercises/if/if1/main_test.go
parent0ee76764b52e325a5bc87b76df8f9e79568916b3 (diff)
feat: add exercise that has tests
Diffstat (limited to 'exercises/if/if1/main_test.go')
-rw-r--r--exercises/if/if1/main_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/exercises/if/if1/main_test.go b/exercises/if/if1/main_test.go
new file mode 100644
index 0000000..589cf7f
--- /dev/null
+++ b/exercises/if/if1/main_test.go
@@ -0,0 +1,25 @@
+// if1
+// Make me compile!
+
+// I AM NOT DONE
+package main_test
+
+import "testing"
+
+func bigger(a int, b int) int {
+ // Complete this function to return the bigger number
+ // Use only if statements
+ return 0
+}
+
+func TestTwoIsBiggerThanOne(t *testing.T) {
+ if bigger(2, 1) != 2 {
+ t.Errorf("2 is bigger than 1")
+ }
+}
+
+func TestTenIsBiggerThanFive(t *testing.T) {
+ if bigger(5, 10) != 10 {
+ t.Errorf("10 is bigger than 5")
+ }
+}