mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
112
node_modules/regexp-clone/test/index.js
generated
vendored
Normal file
112
node_modules/regexp-clone/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
var assert = require('assert')
|
||||
var clone = require('../');
|
||||
|
||||
describe('regexp-clone', function(){
|
||||
function hasEqualSource (a, b) {
|
||||
assert.ok(a !== b);
|
||||
assert.equal(a.source, b.source);
|
||||
}
|
||||
|
||||
function isInsensitive (a) {
|
||||
assert.ok(a.ignoreCase);
|
||||
}
|
||||
|
||||
function isGlobal (a) {
|
||||
assert.ok(a.global);
|
||||
}
|
||||
|
||||
function isMultiline (a) {
|
||||
assert.ok(a.multiline);
|
||||
}
|
||||
|
||||
function insensitiveFlag (a) {
|
||||
var b = clone(a);
|
||||
hasEqualSource(a, b);
|
||||
isInsensitive(a);
|
||||
isInsensitive(b);
|
||||
}
|
||||
|
||||
function globalFlag (a) {
|
||||
var b = clone(a);
|
||||
hasEqualSource(a, b);
|
||||
isGlobal(a);
|
||||
isGlobal(b);
|
||||
}
|
||||
|
||||
function multilineFlag (a) {
|
||||
var b = clone(a);
|
||||
hasEqualSource(a, b);
|
||||
isMultiline(a);
|
||||
isMultiline(b);
|
||||
}
|
||||
|
||||
describe('literals', function(){
|
||||
it('insensitive flag', function(done){
|
||||
var a = /hello/i;
|
||||
insensitiveFlag(a);
|
||||
done();
|
||||
})
|
||||
it('global flag', function(done){
|
||||
var a = /hello/g;
|
||||
globalFlag(a);
|
||||
done();
|
||||
})
|
||||
it('multiline flag', function(done){
|
||||
var a = /hello/m;
|
||||
multilineFlag(a);
|
||||
done();
|
||||
})
|
||||
it('no flags', function(done){
|
||||
var a = /hello/;
|
||||
var b = clone(a);
|
||||
hasEqualSource(a, b);
|
||||
assert.ok(!a.insensitive);
|
||||
assert.ok(!a.global);
|
||||
assert.ok(!a.global);
|
||||
done();
|
||||
})
|
||||
it('all flags', function(done){
|
||||
var a = /hello/gim;
|
||||
insensitiveFlag(a);
|
||||
globalFlag(a);
|
||||
multilineFlag(a);
|
||||
done();
|
||||
})
|
||||
})
|
||||
|
||||
describe('instances', function(){
|
||||
it('insensitive flag', function(done){
|
||||
var a = new RegExp('hello', 'i');
|
||||
insensitiveFlag(a);
|
||||
done();
|
||||
})
|
||||
it('global flag', function(done){
|
||||
var a = new RegExp('hello', 'g');
|
||||
globalFlag(a);
|
||||
done();
|
||||
})
|
||||
it('multiline flag', function(done){
|
||||
var a = new RegExp('hello', 'm');
|
||||
multilineFlag(a);
|
||||
done();
|
||||
})
|
||||
it('no flags', function(done){
|
||||
var a = new RegExp('hmm');
|
||||
var b = clone(a);
|
||||
hasEqualSource(a, b);
|
||||
assert.ok(!a.insensitive);
|
||||
assert.ok(!a.global);
|
||||
assert.ok(!a.global);
|
||||
done();
|
||||
})
|
||||
it('all flags', function(done){
|
||||
var a = new RegExp('hello', 'gim');
|
||||
insensitiveFlag(a);
|
||||
globalFlag(a);
|
||||
multilineFlag(a);
|
||||
done();
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user