From 3fdffe7ce40adc0059473d1623688848d3331af5 Mon Sep 17 00:00:00 2001 From: 23456346 <95267816+23456346@users.noreply.github.com> Date: Thu, 2 Dec 2021 18:29:53 +0800 Subject: [PATCH] Create calculator_test.go --- calculator/calculator_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 calculator/calculator_test.go diff --git a/calculator/calculator_test.go b/calculator/calculator_test.go new file mode 100644 index 0000000..f4e3ab4 --- /dev/null +++ b/calculator/calculator_test.go @@ -0,0 +1,9 @@ +package calculator + +import "testing" + +func TestAdd(t *testing.T) { + if got, want := Add(1, 2), 3; got != want { + t.Errorf("add method produced wrong result. expected: %d, got: %d", want, got) + } +}