|
1 | 1 | import 'package:test/test.dart';
|
2 | 2 | import 'package:lzstring/lzstring.dart';
|
3 | 3 |
|
4 |
| -void main() { |
| 4 | +void main() async { |
5 | 5 | final String input = "測試,测试,テスト,testing";
|
6 |
| - final String normal = LZString.compress(input); |
7 |
| - final String base64 = LZString.compressToBase64(input); |
8 |
| - final String utf16 = LZString.compressToUTF16(input); |
| 6 | + final String normal = await LZString.compress(input); |
| 7 | + final String base64 = await LZString.compressToBase64(input); |
| 8 | + final String utf16 = await LZString.compressToUTF16(input); |
9 | 9 | final String encodedUriComponent =
|
10 |
| - LZString.compressToEncodedURIComponent(input); |
11 |
| - final List<int> uint8Array = LZString.compressToUint8Array(input); |
| 10 | + await LZString.compressToEncodedURIComponent(input); |
| 11 | + final List<int> uint8Array = await LZString.compressToUint8Array(input); |
12 | 12 |
|
13 | 13 | group('compress data', () {
|
14 | 14 | test('to normal', () {
|
@@ -69,25 +69,25 @@ void main() {
|
69 | 69 | });
|
70 | 70 |
|
71 | 71 | group('decompress data', () {
|
72 |
| - test('from normal', () { |
73 |
| - expect(LZString.decompress(normal), equals(input)); |
| 72 | + test('from normal', () async { |
| 73 | + expect(await LZString.decompress(normal), equals(input)); |
74 | 74 | });
|
75 | 75 |
|
76 |
| - test('from base 64', () { |
77 |
| - expect(LZString.decompressFromBase64(base64), equals(input)); |
| 76 | + test('from base 64', () async { |
| 77 | + expect(await LZString.decompressFromBase64(base64), equals(input)); |
78 | 78 | });
|
79 | 79 |
|
80 |
| - test('from utf 16', () { |
81 |
| - expect(LZString.decompressFromUTF16(utf16), equals(input)); |
| 80 | + test('from utf 16', () async { |
| 81 | + expect(await LZString.decompressFromUTF16(utf16), equals(input)); |
82 | 82 | });
|
83 | 83 |
|
84 |
| - test('from encoded uri component', () { |
85 |
| - expect(LZString.decompressFromEncodedURIComponent(encodedUriComponent), |
| 84 | + test('from encoded uri component', () async { |
| 85 | + expect(await LZString.decompressFromEncodedURIComponent(encodedUriComponent), |
86 | 86 | equals(input));
|
87 | 87 | });
|
88 | 88 |
|
89 |
| - test('from uint8 array', () { |
90 |
| - expect(LZString.decompressFromUint8Array(uint8Array), equals(input)); |
| 89 | + test('from uint8 array', () async { |
| 90 | + expect(await LZString.decompressFromUint8Array(uint8Array), equals(input)); |
91 | 91 | });
|
92 | 92 | });
|
93 | 93 | }
|
0 commit comments