make dumps for all tests.

This commit is contained in:
Christopher Jeffrey 2013-07-28 14:29:07 -05:00
parent 3bcbd9b39f
commit 0bc25d9989
19 changed files with 96 additions and 64 deletions

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
.git*
test/
img/

View File

@ -10,6 +10,5 @@
"homepage": "https://github.com/chjj/blessed", "homepage": "https://github.com/chjj/blessed",
"bugs": { "url": "http://github.com/chjj/blessed/issues" }, "bugs": { "url": "http://github.com/chjj/blessed/issues" },
"keywords": ["curses", "tui", "tput"], "keywords": ["curses", "tui", "tput"],
"tags": ["curses", "tui", "tput"], "tags": ["curses", "tui", "tput"]
"scripts": { "test": "node test", "bench": "node test --bench" }
} }

View File

@ -1,23 +0,0 @@
var blessed = require('../')
, screen = blessed.screen();
var main = blessed.box({
width: screen.width,
height: screen.height,
bg: 'yellow',
top: 0,
left: 0,
content: 'Welcome to my program\na\nb\nc\nd\ne\nf\ng\nh'
});
screen.append(main);
screen.render();
screen.insertTop(1, screen.height - 3);
//screen.insertBottom(1, screen.height - 3);
//screen.insertBottom(1, screen.height - 3);
screen.on('keypress', function(ch, key) {
if (key.name === 'q') return process.exit(0);
});

1
test/logs/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, program = blessed(); , program;
program = blessed.program({
dump: __dirname + '/logs/mouse.log'
});
// program.setMouse({ // program.setMouse({
// allMotion: true, // allMotion: true,

View File

@ -1,27 +1,25 @@
{ header: { header:
{ dataSize: 3270, { dataSize: 3337,
headerSize: 12, headerSize: 12,
magicNumber: 282, magicNumber: 282,
namesSize: 48, namesSize: 28,
boolCount: 38, boolCount: 38,
numCount: 15, numCount: 15,
strCount: 413, strCount: 413,
strTableSize: 1388, strTableSize: 1388,
total: 2342, total: 2322,
extended: extended:
{ dataSize: 928, { dataSize: 1015,
headerSize: 10, headerSize: 10,
boolCount: 2, boolCount: 2,
numCount: 1, numCount: 0,
strCount: 57, strCount: 62,
strTableSize: 117, strTableSize: 126,
lastStrTableOffset: 680, lastStrTableOffset: 751,
total: 245 } }, total: 262 } },
name: 'xterm', name: 'xterm',
names: [ 'xterm' ], names: [ 'xterm' ],
desc: 'xterm terminal emulator (X Window System)', desc: 'X11 terminal emulator',
dir: '/usr/share/terminfo',
file: '/usr/share/terminfo/x/xterm',
bools: bools:
{ auto_left_margin: false, { auto_left_margin: false,
auto_right_margin: true, auto_right_margin: true,
@ -62,7 +60,7 @@
lpi_changes_res: false, lpi_changes_res: false,
backspaces_with_bs: true, backspaces_with_bs: true,
AX: true, AX: true,
XT: false }, XT: true },
numbers: numbers:
{ columns: 80, { columns: 80,
init_tabs: 8, init_tabs: 8,
@ -78,8 +76,7 @@
max_attributes: -1, max_attributes: -1,
maximum_windows: -1, maximum_windows: -1,
max_colors: 8, max_colors: 8,
max_pairs: 64, max_pairs: 64 },
U8: -1 },
strings: strings:
{ back_tab: '\u001b[Z', { back_tab: '\u001b[Z',
bell: '\u0007', bell: '\u0007',
@ -250,7 +247,12 @@
set_a_background: '\u001b[4%p1%dm', set_a_background: '\u001b[4%p1%dm',
memory_lock: '\u001bl', memory_lock: '\u001bl',
memory_unlock: '\u001bm', memory_unlock: '\u001bm',
XM: '', Cr: '\u001b]112\u0007',
Cs: '\u001b]12;%p1%s\u0007',
E3: '\u001b[3;J',
Ms: '\u001b]52;%p1%s;%p2%s\u0007',
Se: '\u001b[2 q',
Ss: '\u001b[%p1%d q',
kDC3: '\u001b[3;3~', kDC3: '\u001b[3;3~',
kDC4: '\u001b[3;4~', kDC4: '\u001b[3;4~',
kDC5: '\u001b[3;5~', kDC5: '\u001b[3;5~',
@ -407,7 +409,7 @@ Compiling cpi_changes_res: false
Compiling lpi_changes_res: false Compiling lpi_changes_res: false
Compiling backspaces_with_bs: true Compiling backspaces_with_bs: true
Compiling AX: true Compiling AX: true
Compiling XT: false Compiling XT: true
Compiling columns: 80 Compiling columns: 80
Compiling init_tabs: 8 Compiling init_tabs: 8
Compiling lines: 24 Compiling lines: 24
@ -423,7 +425,6 @@ Compiling max_attributes: -1
Compiling maximum_windows: -1 Compiling maximum_windows: -1
Compiling max_colors: 8 Compiling max_colors: 8
Compiling max_pairs: 64 Compiling max_pairs: 64
Compiling U8: -1
Compiling back_tab: "\u001b[Z" Compiling back_tab: "\u001b[Z"
return "\x1b[Z"; return "\x1b[Z";
Compiling bell: "\u0007" Compiling bell: "\u0007"
@ -762,7 +763,18 @@ Compiling memory_lock: "\u001bl"
return "\x1bl"; return "\x1bl";
Compiling memory_unlock: "\u001bm" Compiling memory_unlock: "\u001bm"
return "\x1bm"; return "\x1bm";
Compiling XM: "" Compiling Cr: "\u001b]112\u0007"
return "\x1b]112\x07";
Compiling Cs: "\u001b]12;%p1%s\u0007"
var out = ["\x1b]12;"];out.push(params[0]),out.push("\x07");return out.join("");
Compiling E3: "\u001b[3;J"
return "\x1b[3;J";
Compiling Ms: "\u001b]52;%p1%s;%p2%s\u0007"
var out = ["\x1b]52;"];out.push(params[0]),out.push(";"),out.push(params[1]),out.push("\x07");return out.join("");
Compiling Se: "\u001b[2 q"
return "\x1b[2 q";
Compiling Ss: "\u001b[%p1%d q"
var out = ["\x1b["];out.push(params[0]),out.push(" q");return out.join("");
Compiling kDC3: "\u001b[3;3~" Compiling kDC3: "\u001b[3;3~"
return "\x1b[3;3~"; return "\x1b[3;3~";
Compiling kDC4: "\u001b[3;4~" Compiling kDC4: "\u001b[3;4~"

View File

@ -1,8 +1,17 @@
#!/bin/bash #!/bin/bash
node test/tput.js "$@" | tee out term="$1"
out=$(git diff --color=always --no-index test/terminfo out)
rm out dir=$(dirname $(readlink -f "$0"))
cd "$dir/.."
if test -z "$term"; then
term="$dir/../usr/xterm"
set -- "$term" "$@"
fi
node test/tput.js "$@" | grep -v 'dir:\|file:' | tee test/logs/terminfo.log
out=$(git diff --color=always --no-index test/terminfo test/logs/terminfo.log)
if test -n "$out"; then if test -n "$out"; then
echo "$out" | less -c -R echo "$out" | less -c -R

View File

@ -2,7 +2,7 @@ var blessed = require('../')
, screen; , screen;
screen = blessed.screen({ screen = blessed.screen({
dump: __dirname + '/p.log', dump: __dirname + '/logs/csr.log',
smartCSR: true smartCSR: true
}); });

View File

@ -3,7 +3,7 @@ var blessed = require('../');
var screen = blessed.screen({ var screen = blessed.screen({
tput: true, tput: true,
smartCSR: true, smartCSR: true,
dump: __dirname + '/file.log' dump: __dirname + '/logs/file.log'
}); });
var fm = blessed.filemanager({ var fm = blessed.filemanager({

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen({ dump: __dirname + '/form.log' }); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/form.log'
});
var form = blessed.form({ var form = blessed.form({
parent: screen, parent: screen,

View File

@ -1,7 +1,7 @@
var blessed = require('../'); var blessed = require('../');
var screen = blessed.screen({ var screen = blessed.screen({
tput: true dump: __dirname + '/logs/insert.log'
}); });
var box = blessed.box({ var box = blessed.box({

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen(); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/listbar.log'
});
var bar = blessed.listbar({ var bar = blessed.listbar({
parent: screen, parent: screen,

View File

@ -2,8 +2,7 @@ var blessed = require('../')
, screen; , screen;
screen = blessed.screen({ screen = blessed.screen({
dump: __dirname + '/nested-attr.log', dump: __dirname + '/logs/nested-attr.log'
smartCSR: true
}); });
blessed.box({ blessed.box({
@ -18,7 +17,8 @@ blessed.box({
border: { border: {
type: 'ascii' type: 'ascii'
}, },
content: '{red-fg}hello {blue-fg}how{/blue-fg} are you?{/red-fg}' content: '{red-fg}hello {blue-fg}how{/blue-fg}'
+ ' {yellow-bg}are{/yellow-bg} you?{/red-fg}'
}); });
screen.key('q', function() { screen.key('q', function() {

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen(); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/padding.log'
});
blessed.box({ blessed.box({
parent: screen, parent: screen,

View File

@ -1,6 +1,10 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen() , assert = require('assert')
, assert = require('assert'); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/pos.log'
});
// My terminal size at the time of writing these tests: // My terminal size at the time of writing these tests:
screen.program.cols = 154; screen.program.cols = 154;

View File

@ -2,7 +2,7 @@ var blessed = require('../')
, screen; , screen;
screen = blessed.screen({ screen = blessed.screen({
dump: __dirname + '/scrollable-boxes.log', dump: __dirname + '/logs/scrollable-boxes.log',
smartCSR: true smartCSR: true
}); });

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen(); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/shrink-padding.log'
});
var outer = blessed.box({ var outer = blessed.box({
parent: screen, parent: screen,

View File

@ -1,6 +1,9 @@
var blessed = require('../'); var blessed = require('../')
, screen;
var screen = blessed.screen(); screen = blessed.screen({
dump: __dirname + '/logs/textarea.log'
});
var box = blessed.textarea({ var box = blessed.textarea({
parent: screen, parent: screen,

View File

@ -1,5 +1,9 @@
var blessed = require('../') var blessed = require('../')
, screen = blessed.screen(); , screen;
screen = blessed.screen({
dump: __dirname + '/logs/widget.log'
});
screen.append(blessed.text({ screen.append(blessed.text({
top: 0, top: 0,