123456789101112131415161718192021222324 |
- package kata_test
- import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- . "code.osinet.fr/fgm/codewars/kyu5/primes_in_numbers"
- )
- func dotest(n int, exp string) {
- var ans = PrimeFactors(n)
- Expect(ans).To(Equal(exp))
- }
- var _ = Describe("ConvertFracts", func() {
- It("Degenerate", func() {
- dotest(1, "")
- })
- It("Basic tests", func() {
- dotest(7775460, "(2**2)(3**3)(5)(7)(11**2)(17)")
- dotest(79340, "(2**2)(5)(3967)")
- })
- })
|