chore: extract color parser

This commit is contained in:
2024-03-31 00:14:58 +03:00
parent 911e94efd1
commit ed3303c4e6
7 changed files with 24 additions and 377 deletions

View File

@@ -1,23 +0,0 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:mudblock/core/consts.dart';
import 'package:mudblock/core/parser/parser.dart';
const inputs = [
'$esc[32mYou are standing in a small clearing.$esc[0m',
'You are standing in a small clearing.',
'$esc[0m$esc[1m$esc[0m$esc[1m$esc[31mWelcome to SimpleMUD$esc[0m$esc[1m$esc[0m',
'$esc[0m$esc[37m$esc[0m$esc[37m$esc[1m[$esc[0m$esc[37m$esc[1m$esc[32m10$esc[0m$esc[37m$esc[1m/10]$esc[0m$esc[37m$esc[0m'
];
void main() {
group('ColorParser', () {
test('colored output 1', () {
final input = inputs[0];
final output = ColorParser(input).parse();
expect(output, [
ColorToken('You are standing in a small clearing.', 32, 0),
ColorToken.empty(),
]);
});
});
}