-
Notifications
You must be signed in to change notification settings - Fork 323
Expand file tree
/
Copy pathKeyBindingsTest.cs
More file actions
65 lines (54 loc) · 1.96 KB
/
KeyBindingsTest.cs
File metadata and controls
65 lines (54 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System.Linq;
using Microsoft.PowerShell;
using Xunit;
namespace Test
{
public partial class ReadLine
{
[SkippableFact]
public void WhatIsKey()
{
TestSetup(KeyMode.Cmd);
Test("", Keys(
_.Alt_Question,
CheckThat(() => AssertScreenIs(2, NextLine, "what-is-key:")),
'a',
CheckThat(() => AssertScreenIs(2, NextLine, "a: SelfInsert - Insert the key typed"))));
Test("", Keys(
_.Alt_Question, _.F9,
CheckThat(() => AssertScreenIs(2, NextLine, "F9: Key is unbound"))));
Test("", Keys(
_.Alt_Question, _.LeftArrow,
CheckThat(() => AssertScreenIs(2, NextLine, "LeftArrow: BackwardChar - Move the cursor back one character"))
));
TestSetup(KeyMode.Emacs);
Test("", Keys(
_.Alt_Question, _.Ctrl_x, _.Ctrl_u,
CheckThat(() => AssertScreenIs(2, NextLine, "Ctrl+x,Ctrl+u: Undo - Undo a previous edit"))));
}
[SkippableFact]
public void ShowKeyBindings()
{
// I'm too lazy to validate the output as there's a lot of output. So
// just run it a few times to make sure nothing crashes.
TestSetup(KeyMode.Cmd);
Test("", Keys(Enumerable.Repeat(_.Ctrl_Alt_Question, 3)));
TestSetup(KeyMode.Emacs);
Test("", Keys(Enumerable.Repeat(_.Ctrl_Alt_Question, 3)));
TestSetup(KeyMode.Vi);
Test("", Keys(Enumerable.Repeat(_.Ctrl_Alt_Question, 3)));
}
[SkippableFact]
public void ShiftBackspace()
{
TestSetup(KeyMode.Cmd);
Test("aa", Keys("aaa", _.Shift_Backspace));
}
[SkippableFact]
public void ShiftEscape()
{
TestSetup(KeyMode.Cmd);
Test("", Keys("aaa", _.Shift_Escape));
}
}
}