flutter/packages/flutter_tools/test/general.shard/common_test.dart
Jonah Williams 74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00

65 lines
2 KiB
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../src/common.dart';
void main() {
group('containsIgnoreWhitespace Matcher', () {
group('on item to be contained', () {
test('matches simple case.', () {
expect('Give me any text!', containsIgnoringWhitespace('any text!'));
});
test("shouldn't match when it's only because of removing whitespaces", () {
expect('Give me anytext!', isNot(containsIgnoringWhitespace('any text!')));
});
test('ignores trailing spaces.', () {
expect('Give me any text!', containsIgnoringWhitespace('any text! '));
});
test('ignores leading spaces.', () {
expect('Give me any text!', containsIgnoringWhitespace(' any text!'));
});
test('ignores linebreaks.', () {
expect('Give me any text!', containsIgnoringWhitespace('any\n text!'));
});
test('ignores tabs.', () {
expect('Give me any text!', containsIgnoringWhitespace('any\t text!'));
});
test('is case sensitive.', () {
expect('Give me Any text!', isNot(containsIgnoringWhitespace('any text!')));
});
});
group('on value to match against', () {
test('ignores trailing spaces.', () {
expect('Give me any value to include! ',
containsIgnoringWhitespace('any value to include!'));
});
test('ignores leading spaces.', () {
expect(' Give me any value to include!',
containsIgnoringWhitespace('any value to include!'));
});
test('ignores linebreaks.', () {
expect('Give me \n any \n value \n to \n include!',
containsIgnoringWhitespace('any value to include!'));
});
test('ignores tabs.', () {
expect('\tGive\t me any\t value \t to \t include!',
containsIgnoringWhitespace('any value to include!'));
});
});
});
}