Prepare the OpenAPI parser and Dart generator as a publishable Koi package with CLI entrypoint, docs, examples, tests, and pub.dev release metadata. Constraint: Initial GitHub import follows koi_blueprint_flutter identity mr.koi <i@mrkoi.is>. Rejected: Keep local runtime state in the initial repository | .dart_tool, .omx, and pubspec.lock are ignored for a reusable package source tree. Confidence: high Scope-risk: moderate Directive: Keep generated-output behavior covered by parser and generator tests before changing rendering rules. Tested: dart analyze; dart test; PUB_HOSTED_URL=https://pub.dev dart pub publish --dry-run Not-tested: End-to-end downstream build_runner compilation of generated Retrofit/Freezed output.
16 lines
492 B
Dart
16 lines
492 B
Dart
import 'package:koi_swagger_parser/src/util/utils.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
group('toSnakeCase', () {
|
|
test('保持常见缩写合并后的文件名可读性', () {
|
|
expect(toSnakeCase('IoTDeviceResponse'), 'iot_device_response');
|
|
expect(
|
|
toSnakeCase('ApiResponse_IoTDeviceListResponse_'),
|
|
'api_response_iot_device_list_response',
|
|
);
|
|
expect(toSnakeCase('HTTPValidationError'), 'http_validation_error');
|
|
});
|
|
});
|
|
}
|