k_test.go 602 B

12345678910111213141516171819202122232425
  1. // TODO: replace with your own tests (TDD). An example to get you started is included below.
  2. // Ginkgo BDD Testing Framework <http://onsi.github.io/ginkgo></http:>
  3. // Gomega Matcher Library <http://onsi.github.io/gomega></http:>
  4. package kata
  5. import (
  6. . "github.com/onsi/ginkgo"
  7. . "github.com/onsi/gomega"
  8. )
  9. func dotest(prod string, exp int) {
  10. var ans = duplicate_count(prod)
  11. Expect(ans).To(Equal(exp))
  12. }
  13. var _ = Describe("Test Example", func() {
  14. It("should handle basic cases", func() {
  15. dotest("abcde", 0)
  16. dotest("abcdea", 1)
  17. dotest("abcdeaB11", 3)
  18. dotest("indivisibility", 1)
  19. })
  20. })