k_test.go 1.0 KB

123456789101112131415161718192021222324252627
  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. var _ = Describe("Sample Test Cases:", func() {
  10. It("Should return the correct values for the sample test cases!", func() {
  11. Expect(alphanumeric(".*?")).To(Equal(false))
  12. Expect(alphanumeric("a")).To(Equal(true))
  13. Expect(alphanumeric("Mazinkaiser")).To(Equal(true))
  14. Expect(alphanumeric("hello world_")).To(Equal(false))
  15. Expect(alphanumeric("PassW0rd")).To(Equal(true))
  16. Expect(alphanumeric(" ")).To(Equal(false))
  17. Expect(alphanumeric("")).To(Equal(false))
  18. Expect(alphanumeric("\n\t\n")).To(Equal(false))
  19. Expect(alphanumeric("ciao\n$$_")).To(Equal(false))
  20. Expect(alphanumeric("__ * __")).To(Equal(false))
  21. Expect(alphanumeric("&)))(((")).To(Equal(false))
  22. Expect(alphanumeric("43534h56jmTHHF3k")).To(Equal(true))
  23. })
  24. })