mirror of
https://github.com/chenasraf/mudblock.git
synced 2026-05-18 01:48:57 +00:00
chore: extract color parser
This commit is contained in:
@@ -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(),
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user