mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
16 lines
607 B
CoffeeScript
16 lines
607 B
CoffeeScript
chai = require 'chai'
|
|
should = chai.should()
|
|
|
|
describe 'ShexpUtils', ->
|
|
ShexpUtils = require '../src/shexp_utils'
|
|
describe '#escapeSlash', ->
|
|
it 'should escape all forward slashes', ->
|
|
regex = ShexpUtils.escapeSlash '/test/'
|
|
regex.should.equal '\\/test\\/'
|
|
it 'should not escape slashes that are already escaped', ->
|
|
regex = ShexpUtils.escapeSlash '\\/test\\/'
|
|
regex.should.equal '\\/test\\/'
|
|
it 'should know the difference between escaped and unescaped slashes', ->
|
|
regex = ShexpUtils.escapeSlash '\\\\/\\/test\\/'
|
|
regex.should.equal '\\\\\\/\\/test\\/'
|