function SumLetters(a , b ) { return a.length == b.length && a.length > 0 }
package katafunc SumLetters(a string, b string) bool {return len(a) == len(b) && len(a) > 0- function SumLetters(a , b ) {
- return a.length == b.length && a.length > 0
- }
const chai = require("chai"); const assert = chai.assert; chai.config.truncateThreshold=0; describe("SumLetters function",() => { it('should return true', () => { assert.strictEqual(SumLetters("john", "doug"),true) }) it('should return false', () => { assert.strictEqual(SumLetters("penelope", "derrick"),false) }) } )
package kata_testimport (. "github.com/onsi/ginkgo". "github.com/onsi/gomega". "codewarrior/kata")- const chai = require("chai");
- const assert = chai.assert;
- chai.config.truncateThreshold=0;
func dotest(a string, b string, expected bool) {actual := SumLetters(a, b)Expect(actual).To(Equal(expected))}var _ = Describe("Tests", func() {It("Example 1", func() {dotest("Sebastian", "Patricia", false)})It("Example 2", func() {dotest("Anna", "Nana", true)- describe("SumLetters function",() => {
- it('should return true', () => {
- assert.strictEqual(SumLetters("john", "doug"),true)
- })
It("Example 3", func() {dotest("John", "", false)- it('should return false', () => {
- assert.strictEqual(SumLetters("penelope", "derrick"),false)
- })
It("Example 4", func() {dotest("", "", false)})})- } )