k_test.go 447 B

123456789101112131415161718192021222324
  1. package kata_test
  2. import (
  3. . "github.com/onsi/ginkgo"
  4. . "github.com/onsi/gomega"
  5. . "code.osinet.fr/fgm/codewars/kyu5/primes_in_numbers"
  6. )
  7. func dotest(n int, exp string) {
  8. var ans = PrimeFactors(n)
  9. Expect(ans).To(Equal(exp))
  10. }
  11. var _ = Describe("ConvertFracts", func() {
  12. It("Degenerate", func() {
  13. dotest(1, "")
  14. })
  15. It("Basic tests", func() {
  16. dotest(7775460, "(2**2)(3**3)(5)(7)(11**2)(17)")
  17. dotest(79340, "(2**2)(5)(3967)")
  18. })
  19. })