12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package kata_test
- import (
- "fmt"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- . "code.osinet.fr/fgm/codewars/kyu7/functions_of_integers_on_cartesian_plane"
- )
- func dotestSuMin(n int, exp int64) {
- fmt.Printf("SuMin n %v\n", n)
- var ans = SuMin(n)
- Expect(ans).To(Equal(exp))
- }
- func dotestSuMax(n int, exp int64) {
- fmt.Printf("SuMax n %v\n", n)
- var ans = SuMax(n)
- Expect(ans).To(Equal(exp))
- }
- func dotestSumSum(n int, exp int64) {
- fmt.Printf("SumSum n %v\n", n)
- var ans = SumSum(n)
- Expect(ans).To(Equal(exp))
- }
- func sumin() {
- dotestSuMin(5, 55)
- dotestSuMin(100, 338350)
- }
- func sumax() {
- dotestSuMax(5, 95)
- dotestSuMax(100, 671650)
- }
- func susum() {
- dotestSumSum(5, 150)
- dotestSumSum(100, 671650+338350)
- }
- var _ = Describe("Tests", func() {
- It("should handle basic min cases", func() {
- sumin()
- })
- It("should handle basic max cases", func() {
- sumax()
- })
- It("should handle basic sum cases", func() {
- susum()
- })
- })
|