Import IKAR messenger client and server

This commit is contained in:
sevenhill
2026-10-07 22:06:07 +03:00
commit 69ea5091eb
1951 changed files with 424546 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:ikar/core/plugins/plugin_manifest.dart';
import 'package:ikar/frontend/commands/slash_command.dart';
import 'package:ikar/frontend/commands/plugin_commands.dart';
void main() {
const optional = PluginCommandArgumentManifest(
name: 'optional',
description: '',
required: false,
rest: false,
);
const text = PluginCommandArgumentManifest(
name: 'text',
description: '',
required: true,
rest: true,
);
test('empty optional field does not consume the required text', () {
final raw = serializeCommandArguments(
[optional, text],
{'optional': '', 'text': 'alpha beta'},
);
expect(parseCommandArguments(raw, [optional, text]), {
'optional': '',
'text': 'alpha beta',
});
});
test('quoted arguments round trip through the form', () {
const values = {
'optional': 'with "quotes" and spaces',
'text': 'alpha beta',
};
final raw = serializeCommandArguments([optional, text], values);
expect(parseCommandArguments(raw, [optional, text]), values);
});
test('usage includes optional and rest fields', () {
const command = SlashCommand(
'/synthetic',
'Synthetic',
arguments: [optional, text],
);
expect(command.usage, '/synthetic [optional] <text...>');
});
}