diff --git a/spec/parser/javascript/charset_spec.js b/spec/parser/javascript/charset_spec.js
index 2a5bc5e..559706e 100644
--- a/spec/parser/javascript/charset_spec.js
+++ b/spec/parser/javascript/charset_spec.js
@@ -1,4 +1,5 @@
import javascript from 'src/js/parser/javascript/parser.js';
+import Node from 'src/js/parser/javascript/node.js';
import util from 'src/js/util.js';
import _ from 'lodash';
import Snap from 'snapsvg';
@@ -49,6 +50,14 @@ describe('parser/javascript/charset.js', function() {
});
});
+ it('adds a warning for character sets the contain non-standard escapes', function() {
+ var node;
+
+ Node.state = { warnings: [] };
+ node = new javascript.Parser('[\\c]').__consume__charset();
+ expect(node.state.warnings).toEqual(['The character set "[\\c]" contains the \\c escape followed by a character other than A-Z. This can lead to different behavior depending on browser. The representation here is the most common interpretation.']);
+ });
+
describe('_anchor property', function() {
it('calculates the anchor based on the partContainer', function() {
diff --git a/spec/parser/javascript_spec.js b/spec/parser/javascript_spec.js
index 1deb3a6..7ac50bb 100644
--- a/spec/parser/javascript_spec.js
+++ b/spec/parser/javascript_spec.js
@@ -119,4 +119,13 @@ describe('parser/javascript.js', function() {
});
+ describe('warnings property', function() {
+
+ it('returns the content of the warnings state variable', function() {
+ this.parser.state.warnings.push('example');
+ expect(this.parser.warnings).toEqual(['example']);
+ });
+
+ });
+
});
diff --git a/spec/regexper_spec.js b/spec/regexper_spec.js
index 9321daa..b011ec8 100644
--- a/spec/regexper_spec.js
+++ b/spec/regexper_spec.js
@@ -11,6 +11,7 @@ describe('regexper.js', function() {
this.root.innerHTML = [
'
',
'',
+ '
',
'
',
'
',
'
',
@@ -355,6 +356,15 @@ describe('regexper.js', function() {
});
+ describe('#displayWarnings', function() {
+
+ it('adds a list item for each warning', function() {
+ this.regexper.displayWarnings(['warning 1', 'warning 2']);
+ expect(this.regexper.warnings.innerHTML).toEqual('