From 8d1a3f64dc1e491d0d5e79f3e4d176699e637dd4 Mon Sep 17 00:00:00 2001 From: MaurĂ­cio Antunes Date: Sun, 13 Nov 2022 08:56:59 -0300 Subject: feat: add exercise that has tests --- exercises/if/if1/main_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 exercises/if/if1/main_test.go (limited to 'exercises/if/if1') 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") + } +} -- cgit v1.2.3-70-g09d2