k_test.go 573 B

123456789101112131415161718192021222324
  1. package kata_test
  2. import (
  3. . "github.com/onsi/ginkgo"
  4. . "github.com/onsi/gomega"
  5. . "code.osinet.fr/fgm/codewars/kyu4/strings_mix"
  6. )
  7. func dotest(a1 string, a2 string, exp string) {
  8. var ans = Mix(a1, a2)
  9. Expect(ans).To(Equal(exp))
  10. }
  11. var _ = Describe("Tests Mix", func() {
  12. It("should handle basic cases 1", func() {
  13. dotest("Are they here", "yes, they are here", "2:eeeee/2:yy/=:hh/=:rr")
  14. dotest("uuuuuu", "uuuuuu", "=:uuuuuu")
  15. dotest("looping is fun but dangerous", "less dangerous than coding",
  16. "1:ooo/1:uuu/2:sss/=:nnn/1:ii/2:aa/2:dd/2:ee/=:gg")
  17. })
  18. })