Run tests total: 13
Succeeded tests: 8
Failed tests: 5

OK!

FAIL!

This page contains unit tests for the Vim engine. Some of the commands are not implemented, and thus fail the test.

Click on the name of the test to see details.

Usually, a test consists of starting text, commands (key combination), expected result, and what actually engine reported after applying the commands.

A passing test has a green header, and a failing one has red.

Tests

1. Visual mode: yank and paste a word
Hello, [t]his is really nice.
[initial]
vw
[key presses]
Hello, this [i]s really nice.
[expected]
Hello, this [i]s really nice.
[result]
Test succeeded.
y
[key presses]
Hello, [t]his is really nice.
[expected]
Hello, [t]his is really nice.
[result]
Test succeeded.
2w
[key presses]
Hello, this is [r]eally nice.
[expected]
Hello, this is [r]eally nice.
[result]
Test succeeded.
p
[key presses]
Test failed.
TypeError
exception name
Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
exception message
2. Visual mode: yank and paste more than a line
He[l]lo, this is|really nice.
[initial]
vj
[key presses]
Hello, this is|re[a]lly nice.
[expected]
Hello, this is|re[a]lly nice.
[result]
Test succeeded.
y
[key presses]
He[l]lo, this is|really nice.
[expected]
He[l]lo, this is|really nice.
[result]
Test succeeded.
p
[key presses]
He[l]llo, this is|realo, this is|really nice.
[expected]
He[l]lo, this is|really nice.
[result]
Test failed.
3. Visual mode: delete word
Hello, [t]his is really nice.
[initial]
vwd
[key presses]
Hello, [s] really nice.
[expected]
Hello, [s] really nice.
[result]
Test succeeded.
4. Visual mode: delete two words
Hello, [t]his is really nice.
[initial]
vwwd
[key presses]
Hello, [e]ally nice.
[expected]
Hello, [e]ally nice.
[result]
Test succeeded.
5. Visual mode: find until next 'n' and delete
Hello, [t]his is really nice.
[initial]
vfnd
[key presses]
Hello, [n]ice.
[expected]
Hello, [t]his is really nice.
[result]
Test failed.
6. Visual block mode: add prefix for lines
Zero|[F]irst|Second|Third|Fourth
[initial]
ctrl-v
[key presses]
jj
[key presses]
I
[key presses]
-Space
[key presses]
Esc
[key presses]
Zero|[-] First|- Second|- Third|Fourth
[expected]
Zero|[-] First|- Second|- Third|Fourth
[result]
Test succeeded.
7. Visual block mode: advanced movement is allowed
Zero|First|Second|[T]hird|Fourth
[initial]
ctrl-v
[key presses]
bjj
[key presses]
I
[key presses]
-Space
[key presses]
Esc
[key presses]
Zero|First|[-] Second|- Third|Fourth
[expected]
Zero|First|Second|[-] Third|- Fourth
[result]
Test failed.
8. Visual block mode: add text to the end of lines
Zero|Firs[t]|SecondLongIsThis|Third|Fourth
[initial]
ctrl-v
[key presses]
jj
[key presses]
$
[key presses]
?!
[key presses]
Esc
[key presses]
Zero|[F]irst?!|- SecondLongIsThis?!|- Third?!|Fourth?!
[expected]
Zero|First|SecondLongIsThis|Thir[d]|Fourth
[result]
Test failed.