diff --git a/src/python/string/index.js b/src/python/string/index.js index 09f9b52685..a45d0af1d7 100644 --- a/src/python/string/index.js +++ b/src/python/string/index.js @@ -2,3 +2,4 @@ module.exports.ascii_letters = require('./ascii_letters') module.exports.ascii_lowercase = require('./ascii_lowercase') module.exports.ascii_uppercase = require('./ascii_uppercase') module.exports.capwords = require('./capwords') +module.exports.punctuation = require('./punctuation') diff --git a/test/languages/c/stdio/test-sprintf.js b/test/languages/c/stdio/test-sprintf.js index d885ca279c..f86d072910 100644 --- a/test/languages/c/stdio/test-sprintf.js +++ b/test/languages/c/stdio/test-sprintf.js @@ -11,4 +11,10 @@ describe('src/c/stdio/sprintf.js (tested in test/languages/c/stdio/test-sprintf. expect(result).to.deep.equal(expected) done() }) + it('should pass example 2', function (done) { + var expected = 'Param is a 90% good boy.' + var result = sprintf('%s is a %d%% %s %s.', 'Param', 90, 'good', 'boy') + expect(result).to.deep.equal(expected) + done() + }) }) diff --git a/test/languages/php/strings/test-str_ireplace.js b/test/languages/php/strings/test-str_ireplace.js index eddf4cb7d6..8352772669 100644 --- a/test/languages/php/strings/test-str_ireplace.js +++ b/test/languages/php/strings/test-str_ireplace.js @@ -21,4 +21,10 @@ describe('src/php/strings/str_ireplace.js (tested in test/languages/php/strings/ expect(result).to.deep.equal(expected) done() }) + it('should pass example 3', function (done) { + var expected = 'aaa' + var result = str_ireplace('', '.', 'aaa') + expect(result).to.deep.equal(expected) + done() + }) }) diff --git a/test/languages/php/strings/test-str_replace.js b/test/languages/php/strings/test-str_replace.js index 740ccec3c8..82a83cc472 100644 --- a/test/languages/php/strings/test-str_replace.js +++ b/test/languages/php/strings/test-str_replace.js @@ -33,4 +33,10 @@ describe('src/php/strings/str_replace.js (tested in test/languages/php/strings/t expect(result).to.deep.equal(expected) done() }) + it('should pass example 5', function (done) { + var expected = 'aaa' + var result = str_replace('', '.', 'aaa') + expect(result).to.deep.equal(expected) + done() + }) }) diff --git a/test/languages/python/string/test-punctuation.js b/test/languages/python/string/test-punctuation.js new file mode 100644 index 0000000000..b7a5e42333 --- /dev/null +++ b/test/languages/python/string/test-punctuation.js @@ -0,0 +1,14 @@ +// warning: This file is auto generated by `npm run build:tests` +// Do not edit by hand! +process.env.TZ = 'UTC' +var expect = require('chai').expect +var punctuation = require('../../../../src/python/string/punctuation.js') // eslint-disable-line no-unused-vars,camelcase + +describe('src/python/string/punctuation.js (tested in test/languages/python/string/test-punctuation.js)', function () { + it('should pass example 1', function (done) { + var expected = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" + var result = punctuation() + expect(result).to.deep.equal(expected) + done() + }) +})