diff options
| author | Aram Drevekenin <aram@poor.dev> | 2020-11-23 18:01:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-23 18:01:16 +0100 |
| commit | f88abe6ad86da27695dac82ea8ad2e1c6fd4cc9e (patch) | |
| tree | fddfea76ffc9bba8ba735e0d120dfb62b94f33e6 /src/tests | |
| parent | fix(layout): total layout percent 100 validation (#57) (diff) | |
| download | sl0ppij-f88abe6ad86da27695dac82ea8ad2e1c6fd4cc9e.tar.gz sl0ppij-f88abe6ad86da27695dac82ea8ad2e1c6fd4cc9e.tar.xz sl0ppij-f88abe6ad86da27695dac82ea8ad2e1c6fd4cc9e.zip | |
fix(compatibility): various htop issues (#66)
* fix(compatibility): various htop issues
* style(format): make rustfmt happy
* fix(logging): do not delete log dir on startup
* fix(tests): update htop with command toggle
* chore(ci): reduce test concurrency to 1
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/fixtures/htop | bin | 0 -> 16234 bytes | |||
| -rw-r--r-- | src/tests/integration/compatibility.rs | 23 | ||||
| -rw-r--r-- | src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop-2.snap | 32 | ||||
| -rw-r--r-- | src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop.snap | 32 |
4 files changed, 87 insertions, 0 deletions
diff --git a/src/tests/fixtures/htop b/src/tests/fixtures/htop Binary files differnew file mode 100644 index 00000000..37ee0777 --- /dev/null +++ b/src/tests/fixtures/htop diff --git a/src/tests/integration/compatibility.rs b/src/tests/integration/compatibility.rs index a763d594..8034bfb4 100644 --- a/src/tests/integration/compatibility.rs +++ b/src/tests/integration/compatibility.rs @@ -192,3 +192,26 @@ pub fn vim_ctrl_u() { assert_snapshot!(snapshot); } } + +#[test] +pub fn htop() { + let fake_win_size = PositionAndSize { + columns: 116, + rows: 28, + x: 0, + y: 0, + }; + let fixture_name = "htop"; + let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name); + fake_input_output.add_terminal_input(&[COMMAND_TOGGLE, COMMAND_TOGGLE, QUIT]); + start(Box::new(fake_input_output.clone()), Opt::default()); + let output_frames = fake_input_output + .stdout_writer + .output_frames + .lock() + .unwrap(); + let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size); + for snapshot in snapshots { + assert_snapshot!(snapshot); + } +} diff --git a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop-2.snap b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop-2.snap new file mode 100644 index 00000000..2fa4647b --- /dev/null +++ b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop-2.snap @@ -0,0 +1,32 @@ +--- +source: src/tests/integration/compatibility.rs +expression: snapshot +--- + 1 [||||| 10.1%] Tasks: 73, 413 thr; 1 running + 2 [||||||| 13.5%] Load average: 1.03 1.07 1.30 + 3 [|||||| 10.8%] Uptime: 22:41:15 + 4 [|||||| 10.6%] + Mem[|||||||||||||||||||||||||||||||||||||3.28G/15.3G] + Swp[ 0K/16.0G] + + PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command + 1352 aram 20 0 3776M 581M 238M S 8.7 3.7 2h01:10 /usr/lib/firefox/firefox + 98777 aram 20 0 537M 6184 4240 S 8.1 0.0 0:00.80 target/debug/mosaic --debug + 1669 aram 20 0 2944M 318M 130M S 8.1 2.0 1h01:33 /usr/lib/firefox/firefox -contentproc -childID 6 -i + 826 aram 9 -11 1581M 15092 11244 S 6.1 0.1 42:21.83 /usr/bin/pulseaudio --daemonize=no + 9419 aram 20 0 533M 7392 3344 S 4.7 0.0 22:01.92 /usr/local/bin/mosaic --max-panes 4 + 98913 aram 20 0 537M 6184 4240 S 3.4 0.0 0:00.31 target/debug/mosaic --debug + 1505 aram 20 0 3187M 329M 206M S 3.4 2.1 23:35.90 /usr/lib/firefox/firefox -contentproc -childID 2 -i + 98912 aram 20 0 537M 6184 4240 S 2.7 0.0 0:00.22 target/debug/mosaic --debug + 1164 aram -6 0 1581M 15092 11244 S 2.7 0.1 21:39.80 /usr/bin/pulseaudio --daemonize=no + 1247 aram 20 0 1184M 292M 84828 S 2.7 1.9 38:01.54 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth / + 1475 aram -11 0 3776M 581M 238M S 2.0 3.7 14:27.94 /usr/lib/firefox/firefox + 8574 aram 20 0 2944M 318M 130M S 2.0 2.0 14:36.50 /usr/lib/firefox/firefox -contentproc -childID 6 -i + 1364 aram 20 0 3776M 581M 238M S 2.0 3.7 18:01.89 /usr/lib/firefox/firefox + 1870 aram 20 0 3776M 581M 238M S 2.0 3.7 13:27.06 /usr/lib/firefox/firefox + 9427 aram 20 0 533M 7392 3344 S 2.0 0.0 6:53.47 /usr/local/bin/mosaic --max-panes 4 + 98905 aram 20 0 537M 6184 4240 S 2.0 0.0 0:00.17 target/debug/mosaic --debug + 99272 aram 20 0 8456 4348 3320 R 1.3 0.0 0:00.13 htop + 8611 aram 20 0 2944M 318M 130M S 1.3 2.0 8:17.90 /usr/lib/firefox/firefox -contentproc -childID 6 -i +F1Help F2Setup F3SearchF4FilterF5Tree F6SortByF7Nice -F8Nice +F9Kill F10Quit +Bye from Mosaic! diff --git a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop.snap b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop.snap new file mode 100644 index 00000000..98351875 --- /dev/null +++ b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__htop.snap @@ -0,0 +1,32 @@ +--- +source: src/tests/integration/compatibility.rs +expression: snapshot +--- + + 1 [||||| 10.1%] Tasks: 73, 413 thr; 1 running + 2 [||||||| 13.5%] Load average: 1.03 1.07 1.30 + 3 [|||||| 10.8%] Uptime: 22:41:15 + 4 [|||||| 10.6%] + Mem[|||||||||||||||||||||||||||||||||||||3.28G/15.3G] + Swp[ 0K/16.0G] + + PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command + 1352 aram 20 0 3776M 581M 238M S 8.7 3.7 2h01:10 /usr/lib/firefox/firefox + 98777 aram 20 0 537M 6184 4240 S 8.1 0.0 0:00.80 target/debug/mosaic --debug + 1669 aram 20 0 2944M 318M 130M S 8.1 2.0 1h01:33 /usr/lib/firefox/firefox -contentproc -childID 6 -i + 826 aram 9 -11 1581M 15092 11244 S 6.1 0.1 42:21.83 /usr/bin/pulseaudio --daemonize=no + 9419 aram 20 0 533M 7392 3344 S 4.7 0.0 22:01.92 /usr/local/bin/mosaic --max-panes 4 + 98913 aram 20 0 537M 6184 4240 S 3.4 0.0 0:00.31 target/debug/mosaic --debug + 1505 aram 20 0 3187M 329M 206M S 3.4 2.1 23:35.90 /usr/lib/firefox/firefox -contentproc -childID 2 -i + 98912 aram 20 0 537M 6184 4240 S 2.7 0.0 0:00.22 target/debug/mosaic --debug + 1164 aram -6 0 1581M 15092 11244 S 2.7 0.1 21:39.80 /usr/bin/pulseaudio --daemonize=no + 1247 aram 20 0 1184M 292M 84828 S 2.7 1.9 38:01.54 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth / + 1475 aram -11 0 3776M 581M 238M S 2.0 3.7 14:27.94 /usr/lib/firefox/firefox + 8574 aram 20 0 2944M 318M 130M S 2.0 2.0 14:36.50 /usr/lib/firefox/firefox -contentproc -childID 6 -i + 1364 aram 20 0 3776M 581M 238M S 2.0 3.7 18:01.89 /usr/lib/firefox/firefox + 1870 aram 20 0 3776M 581M 238M S 2.0 3.7 13:27.06 /usr/lib/firefox/firefox + 9427 aram 20 0 533M 7392 3344 S 2.0 0.0 6:53.47 /usr/local/bin/mosaic --max-panes 4 + 98905 aram 20 0 537M 6184 4240 S 2.0 0.0 0:00.17 target/debug/mosaic --debug + 99272 aram 20 0 8456 4348 3320 R 1.3 0.0 0:00.13 htop + 8611 aram 20 0 2944M 318M 130M S 1.3 2.0 8:17.90 /usr/lib/firefox/firefox -contentproc -childID 6 -i +F1Help F2Setup F3SearchF4FilterF5Tree F6SortByF7Nice -F8Nice +F9Kill F10Quit |
