blob: 8f7c1ecf075c62a12181eb29e1e5f8fbcd56e6ad [file] [log] [blame]
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/utilities/extensions/string.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
void main() {
defineReflectiveSuite(() {
defineReflectiveTests(ToLowerCamelCaseTest);
});
}
@reflectiveTest
class ToLowerCamelCaseTest {
void test_adjacentUnderscores() {
expect('a__b'.toLowerCamelCase, null);
}
void test_empty() {
expect(''.toLowerCamelCase, null);
}
void test_leadingUnderscore() {
expect('_a'.toLowerCamelCase, null);
}
void test_screamingCaps() {
expect('AA_BB'.toLowerCamelCase, 'aaBb');
}
void test_snakeCase() {
expect('aa_bb'.toLowerCamelCase, 'aaBb');
}
void test_trailingUnderscore() {
expect('a_'.toLowerCamelCase, null);
}
}