| Server IP : 185.11.201.71 / Your IP : 192.168.7.18 Web Server : Apache/2.4.29 (Ubuntu) System : Linux tech-virtual-machine 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 User : tech ( 1000) PHP Version : 7.4.28 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/npm/node_modules/ansicolors/test/ |
Upload File : |
'use strict';
var assert = require('assert')
, colors = require('..')
, open = colors.open
, close = colors.close
console.log('Foreground colors ..');
assert.equal(colors.white('printed in white'), '\u001b[37mprinted in white\u001b[39m');
assert.equal(colors.black('printed in black'), '\u001b[30mprinted in black\u001b[39m');
assert.equal(colors.brightBlack('printed in bright black'), '\u001b[90mprinted in bright black\u001b[39m');
assert.equal(colors.green('printed in green'), '\u001b[32mprinted in green\u001b[39m');
assert.equal(colors.brightGreen('printed in bright green'), '\u001b[92mprinted in bright green\u001b[39m');
assert.equal(colors.red('printed in red'), '\u001b[31mprinted in red\u001b[39m');
assert.equal(colors.brightRed('printed in bright red'), '\u001b[91mprinted in bright red\u001b[39m');
console.log('OK');
console.log('Background colors ..');
assert.equal(
colors.bgBlack('printed with black background')
, '\u001b[40mprinted with black background\u001b[49m'
);
assert.equal(
colors.bgYellow('printed with yellow background')
, '\u001b[43mprinted with yellow background\u001b[49m'
);
assert.equal(
colors.bgBrightYellow('printed with bright yellow background')
, '\u001b[103mprinted with bright yellow background\u001b[49m'
);
assert.equal(
colors.bgWhite('printed with white background')
, '\u001b[47mprinted with white background\u001b[49m'
);
console.log('OK');
console.log('Mixing background and foreground colors ..');
assert.equal(
colors.blue(colors.bgYellow('printed in blue with yellow background'))
, '\u001b[34m\u001b[43mprinted in blue with yellow background\u001b[49m\u001b[39m'
);
assert.equal(
colors.bgYellow(colors.blue('printed in blue with yellow background again'))
, '\u001b[43m\u001b[34mprinted in blue with yellow background again\u001b[39m\u001b[49m'
);
console.log('OK');
console.log('Open ...');
assert.equal(open.black, '\u001b[30m');
assert.equal(open.bgYellow, '\u001b[43m');
console.log('OK');
console.log('Close ...');
assert.equal(close.black, '\u001b[39m');
assert.equal(close.bgYellow, '\u001b[49m');
console.log('OK');