nur-sery/tests/strTest.php

29 lines
1022 B
PHP
Raw Normal View History

2024-06-13 15:11:02 +04:00
<?php
namespace nur\sery;
use nulib\tests\TestCase;
class strTest extends TestCase {
function testCamel2us() {
self::assertSame("a", str::camel2us("a"));
self::assertSame("aa", str::camel2us("aa"));
self::assertSame("aaa", str::camel2us("aaa"));
self::assertSame("a", str::camel2us("A"));
self::assertSame("aa", str::camel2us("Aa"));
self::assertSame("aa", str::camel2us("AA"));
self::assertSame("aaa", str::camel2us("Aaa"));
self::assertSame("aaa", str::camel2us("AAA"));
self::assertSame("a_aa", str::camel2us("AAa"));
self::assertSame("a_b", str::camel2us("aB"));
self::assertSame("aa_bb", str::camel2us("aaBb"));
self::assertSame("aaa_bbb", str::camel2us("aaaBbb"));
self::assertSame("aa_bb", str::camel2us("AaBb"));
self::assertSame("aaa_bbb", str::camel2us("AaaBbb"));
2024-06-13 19:16:32 +04:00
self::assertSame("_aaa", str::camel2us("_aaa"));
self::assertSame("__aaa_bbb", str::camel2us("__aaaBbb"));
self::assertSame("___aaa_bbb", str::camel2us("___AaaBbb"));
2024-06-13 15:11:02 +04:00
}
}