2021-05-17 14:50:37 +00:00
|
|
|
library inflection3.spinal_case.test;
|
2021-05-02 08:39:25 +00:00
|
|
|
|
2021-05-17 15:10:07 +00:00
|
|
|
import 'package:inflection3/inflection3.dart';
|
2021-05-02 08:39:25 +00:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
2021-05-17 15:10:07 +00:00
|
|
|
group('The SpinalCaseEncoder', () {
|
|
|
|
test('converts phrases to "spinal-case"', () {
|
2021-05-02 08:39:25 +00:00
|
|
|
expect(SPINAL_CASE.convert(''), equals(''));
|
2021-05-17 15:10:07 +00:00
|
|
|
expect(SPINAL_CASE.convert('CamelCaseName'), equals('camel-case-name'));
|
|
|
|
expect(SPINAL_CASE.convert('propertyName'), equals('property-name'));
|
|
|
|
expect(SPINAL_CASE.convert('property'), equals('property'));
|
|
|
|
expect(SPINAL_CASE.convert('snake_case'), equals('snake-case'));
|
|
|
|
expect(SPINAL_CASE.convert('This is a nice article'),
|
|
|
|
equals('this-is-a-nice-article'));
|
2021-05-02 08:39:25 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|