forked from cubetiq/cubetiq_dart_shared
Task: Add text formatter functions and updated for configurable from the latest
functions with future and async support and add tests and examples
This commit is contained in:
15
test/cubetiq_text_formatter_test.dart
Normal file
15
test/cubetiq_text_formatter_test.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:cubetiq/text.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
test('text formatter function format', () {
|
||||
var text1 = 'Hello, {0}!';
|
||||
var result1 = TextFormatter(text1).format(['Sambo']);
|
||||
|
||||
var text2 = 'Hello, {name}!';
|
||||
var result2 = TextFormatter(text2).decorate({'name': 'Chea'});
|
||||
|
||||
expect('Hello, Sambo!', result1);
|
||||
expect('Hello, Chea!', result2);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user