mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 17:46:29 +09:00
lib.strings: init toCamelCase
This commit is contained in:
parent
24249d45f7
commit
24e8a790b7
3 changed files with 80 additions and 0 deletions
|
@ -969,6 +969,28 @@ runTests {
|
|||
|
||||
testToSentenceCasePath = testingThrow (strings.toSentenceCase ./.);
|
||||
|
||||
testToCamelCase = {
|
||||
expr = strings.toCamelCase "hello world";
|
||||
expected = "helloWorld";
|
||||
};
|
||||
|
||||
testToCamelCaseFromKebab = {
|
||||
expr = strings.toCamelCase "hello-world";
|
||||
expected = "helloWorld";
|
||||
};
|
||||
|
||||
testToCamelCaseFromSnake = {
|
||||
expr = strings.toCamelCase "hello_world";
|
||||
expected = "helloWorld";
|
||||
};
|
||||
|
||||
testToCamelCaseFromPascal = {
|
||||
expr = strings.toCamelCase "HelloWorld";
|
||||
expected = "helloWorld";
|
||||
};
|
||||
|
||||
testToCamelCasePath = testingThrow (strings.toCamelCase ./.);
|
||||
|
||||
testToInt = testAllTrue [
|
||||
# Naive
|
||||
(123 == toInt "123")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue