platform-common-utilities/packages/combinator/test/match_test.dart
2021-09-11 21:46:31 +08:00

16 lines
463 B
Dart

import 'package:angel3_combinator/belatuk_combinator.dart';
import 'package:test/test.dart';
import 'common.dart';
void main() {
test('match string', () {
expect(match('hello').parse(scan('hello world')).successful, isTrue);
});
test('match start only', () {
expect(match('hello').parse(scan('goodbye hello')).successful, isFalse);
});
test('fail if no match', () {
expect(match('hello').parse(scan('world')).successful, isFalse);
});
}