k_test.go 743 B

12345678910111213141516171819202122232425262728293031
  1. package kata_test
  2. import (
  3. . "github.com/onsi/ginkgo"
  4. . "github.com/onsi/gomega"
  5. )
  6. func dotestVert(a1 string, exp string) {
  7. var ans = Oper(VertMirror, a1)
  8. Expect(ans).To(Equal(exp))
  9. }
  10. func dotestHor(a1 string, exp string) {
  11. var ans = Oper(HorMirror, a1)
  12. Expect(ans).To(Equal(exp))
  13. }
  14. var _ = Describe("Tests Moves", func() {
  15. It("should handle basic cases Oper VertMirror", func() {
  16. dotestVert("hSgdHQ\nHnDMao\nClNNxX\niRvxxH\nbqTVvA\nwvSyRu", "QHdgSh\noaMDnH\nXxNNlC\nHxxvRi\nAvVTqb\nuRySvw")
  17. })
  18. It("should handle basic cases Oper HorMirror", func() {
  19. dotestHor("lVHt\nJVhv\nCSbg\nyeCt", "yeCt\nCSbg\nJVhv\nlVHt")
  20. })
  21. It("should reverse single row string", func() {
  22. Expect(Reverse("Andante")).To(Equal("etnadnA"))
  23. })
  24. })