]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / text-table / test / ansi-colors.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js
new file mode 100644 (file)
index 0000000..fbc5bb1
--- /dev/null
@@ -0,0 +1,32 @@
+var test = require('tape');
+var table = require('../');
+var color = require('cli-color');
+var ansiTrim = require('cli-color/lib/trim');
+
+test('center', function (t) {
+    t.plan(1);
+    var opts = {
+        align: [ 'l', 'c', 'l' ],
+        stringLength: function(s) { return ansiTrim(s).length }
+    };
+    var s = table([
+        [
+            color.red('Red'), color.green('Green'), color.blue('Blue')
+        ],
+        [
+            color.bold('Bold'), color.underline('Underline'),
+            color.italic('Italic')
+        ],
+        [
+            color.inverse('Inverse'), color.strike('Strike'),
+            color.blink('Blink')
+        ],
+        [ 'bar', '45', 'lmno' ]
+    ], opts);
+    t.equal(ansiTrim(s), [
+        'Red        Green    Blue',
+        'Bold     Underline  Italic',
+        'Inverse    Strike   Blink',
+        'bar          45     lmno'
+    ].join('\n'));
+});