.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / text-table / test / ansi-colors.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/text-table/test/ansi-colors.js b/.config/coc/extensions/node_modules/coc-prettier/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'));
+});