Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -1,2 +1,2 @@
{{omit from|BBC BASIC}}
Using a well known testing specific library/module/suite for your language, write some tests for your language's entry in [[Palindrome]]. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in [[Palindrome]]. If your language does not have a testing specific library well known to the language's community then state this or omit the language.

View file

@ -0,0 +1,24 @@
const assert = require('assert');
describe('palindrome', () => {
const pali = require('../lib/palindrome');
describe('.check()', () => {
it('should return true on encountering a palindrome', () => {
assert.ok(pali.check('racecar'));
assert.ok(pali.check('abcba'));
assert.ok(pali.check('aa'));
assert.ok(pali.check('a'));
});
it('should return true on encountering an empty string', () => {
assert.ok(pali.check(''));
});
it('should return false on encountering a non-palindrome', () => {
assert.ok(!pali.check('alice'));
assert.ok(!pali.check('ab'));
assert.ok(!pali.check('abcdba'));
});
})
});