-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhighlight_suffix_test.dart
50 lines (45 loc) · 1.16 KB
/
highlight_suffix_test.dart
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
import 'package:dart_consul/dart_consul.dart';
import 'package:krok_term/src/krok_term/core/krok_core.dart';
import 'package:test/test.dart';
void main() {
test("adds highlighted suffix", () {
//given
final it = "XBT";
//when
final actual = it.highlightSuffix(suffix: "USD");
//then
expect(actual, equals("XBT${"/USD".gray()}"));
});
test("highlights pair", () {
//given
final it = "XBTUSD";
//when
final actual = it.highlightSuffix(suffix: "USD");
//then
expect(actual, equals("XBT${"/USD".gray()}"));
});
test("highlights separated pair", () {
//given
final it = "XBT/USD";
//when
final actual = it.highlightSuffix(suffix: "USD");
//then
expect(actual, equals("XBT${"/USD".gray()}"));
});
test("highlights part after /", () {
//given
final it = "XBT/USD";
//when
final actual = it.highlightSuffix();
//then
expect(actual, equals("XBT${"/USD".gray()}"));
});
test("highlights part after #", () {
//given
final it = "XBT#USD";
//when
final actual = it.highlightSuffix(separator: '#');
//then
expect(actual, equals("XBT${"#USD".gray()}"));
});
}