Permalink
Browse files

add tests of escaper

  • Loading branch information...
XadillaX committed Oct 23, 2015
1 parent 58800ab commit 586e7eaa614caca00dcf9616023a0c4d1fb0ecff
Showing with 28 additions and 0 deletions.
  1. +28 −0 test/escaper.js
@@ -0,0 +1,28 @@
/**
* XadillaX created at 2015-10-23 11:02:46 With ♥
*
* Copyright (c) 2015 Souche.com, all rights
* reserved.
*/
require("should");
var escaper = require("../lib/escaper");

describe("Escaper", function() {
describe("escape", function() {
it("should not escape", function() {
escaper.escape(1).should.be.eql(1);
});

it("should escape", function() {
escaper.escape("\n'\"\t\r\b\x1a\\\0")
.should.be.eql("\\n\\'\\\"\\t\\r\\b\\Z\\\\\\0");
});
});

describe("escapeLike", function() {
it("should escape", function() {
escaper.escapeLike("foo_bar % baz")
.should.be.eql("foo\\_bar \\% baz");
});
});
});

0 comments on commit 586e7ea

Please sign in to comment.