Skip to content
Snippets Groups Projects
Commit 946d2bb7 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[powershell mode] Remove ES5-ism from tests

parent a37da5cc
No related branches found
No related tags found
No related merge requests found
......@@ -5,18 +5,20 @@
var mode = CodeMirror.getMode({indentUnit: 2}, "powershell");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
function forEach(arr, f) { for (var i = 0; i < arr.length; i++) f(arr[i], i) }
MT('comment', '[number 1][comment # A]');
MT('comment_multiline', '[number 1][comment <#]',
'[comment ABC]',
'[comment #>][number 2]');
[
forEach([
'0', '1234',
'12kb', '12mb', '12Gb', '12Tb', '12PB', '12L', '12D', '12lkb', '12dtb',
'1.234', '1.234e56', '1.', '1.e2', '.2', '.2e34',
'1.2MB', '1.kb', '.1dTB', '1.e1gb', '.2', '.2e34',
'0x1', '0xabcdef', '0x3tb', '0xelmb'
].forEach(function(number) {
], function(number) {
MT("number_" + number, "[number " + number + "]");
});
......@@ -60,9 +62,9 @@
MT('operator_unary', "[operator +][number 3]");
MT('operator_long', "[operator -match]");
[
forEach([
'(', ')', '[[', ']]', '{', '}', ',', '`', ';', '.'
].forEach(function(punctuation) {
], function(punctuation) {
MT("punctuation_" + punctuation.replace(/^[\[\]]/,''), "[punctuation " + punctuation + "]");
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment