Add test for different RegExp flags.

This commit is contained in:
George Kats 2013-06-05 23:26:42 +03:00
parent f62eb19a66
commit 2c4da4a91a
3 changed files with 18 additions and 0 deletions

View file

@ -190,6 +190,12 @@ suite('assert', function () {
test('deepEqual /regexp/', function(){
assert.deepEqual(/a/, /a/);
assert.notDeepEqual(/a/, /b/);
assert.deepEqual(/a/g, /a/g);
assert.notDeepEqual(/a/g, /b/g);
assert.deepEqual(/a/i, /a/i);
assert.notDeepEqual(/a/i, /b/i);
assert.deepEqual(/a/m, /a/m);
assert.notDeepEqual(/a/m, /b/m);
});
test('deepEqual (circular)', function() {

View file

@ -320,6 +320,12 @@ suite('expect', function () {
test('deep.equal(/regexp/)', function(){
expect(/a/).to.deep.equal(/a/);
expect(/a/).not.to.deep.equal(/b/);
expect(/a/g).to.deep.equal(/a/g);
expect(/a/g).not.to.deep.equal(/b/g);
expect(/a/i).to.deep.equal(/a/i);
expect(/a/i).not.to.deep.equal(/b/i);
expect(/a/m).to.deep.equal(/a/m);
expect(/a/m).not.to.deep.equal(/b/m);
});
test('empty', function(){

View file

@ -270,6 +270,12 @@ suite('should', function() {
({ foo: 'bar' }).should.eql({ foo: 'bar' });
/a/.should.eql(/a/);
/a/.should.not.eql(/b/);
/a/g.should.eql(/a/g);
/a/g.should.not.eql(/b/g);
/a/i.should.eql(/a/i);
/a/i.should.not.eql(/b/i);
/a/m.should.eql(/a/m);
/a/m.should.not.eql(/b/m);
(1).should.eql(1);
'4'.should.not.eql(4);