| 2508 | !Win32OperatingSystemTest methodsFor:'tests-unicodeRename'! |
| 2509 | |
| 2510 | testRenameSubKey_01 |
| 2511 | "Testing if subKey is correctly renamed" |
| 2512 | | readData testingRegistryEntryPath | |
| 2513 | |
| 2514 | testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2515 | |
| 2516 | self assert: (testingRegistryEntryPath renameSubKey: ' ルすしか_testing_delete' to: 'RenamedSubKey'). |
| 2517 | readData := testingRegistryEntryPath subKeyNamed: 'RenamedSubKey'. |
| 2518 | |
| 2519 | self assert: readData notEmptyOrNil. |
| 2520 | self assert: readData path = (registryPath, '\', 'RenamedSubKey'). |
| 2521 | |
| 2522 | " |
| 2523 | self run:#testRenameSubKey_01 |
| 2524 | self new testRenameSubKey_01 |
| 2525 | " |
| 2526 | |
| 2527 | "Created: / 09-04-2019 / 09:05:28 / svestkap" |
| 2528 | ! |
| 2529 | |
| 2530 | testRenameSubKey_02 |
| 2531 | "Testing if subKey is correctly renamed" |
| 2532 | | readData testingRegistryEntryPath | |
| 2533 | |
| 2534 | testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2535 | |
| 2536 | self assert: (testingRegistryEntryPath renameSubKey: ' ルすしか_testing_delete' to: 'すしか_'). |
| 2537 | readData := testingRegistryEntryPath subKeyNamed: 'すしか_'. |
| 2538 | |
| 2539 | self assert: readData notEmptyOrNil. |
| 2540 | self assert: readData path = (registryPath, '\', 'すしか_'). |
| 2541 | |
| 2542 | testingRegistryEntryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', 'すしか_'). |
| 2543 | readData := testingRegistryEntryPath subKeyNamed: 'bobr'. |
| 2544 | |
| 2545 | self assert: readData notEmptyOrNil. |
| 2546 | self assert: readData path = (registryPath, '\', 'すしか_', '\', 'bobr') |
| 2547 | |
| 2548 | " |
| 2549 | self run:#testRenameSubKey_02 |
| 2550 | self new testRenameSubKey_02 |
| 2551 | " |
| 2552 | |
| 2553 | "Created: / 09-04-2019 / 09:35:05 / svestkap" |
| 2554 | ! |
| 2555 | |
| 2556 | testRenameSubKey_03 |
| 2557 | "Testing when renamed subKey does not exist" |
| 2558 | | readData testingRegistryEntryPath | |
| 2559 | |
| 2560 | testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2561 | |
| 2562 | self deny: (testingRegistryEntryPath renameSubKey: 'a key that does not exist' to: 'すしか_'). |
| 2563 | readData := testingRegistryEntryPath subKeyNamed: 'すしか_'. |
| 2564 | |
| 2565 | self assert: readData isEmptyOrNil |
| 2566 | |
| 2567 | " |
| 2568 | self run:#testRenameSubKey_03 |
| 2569 | self new testRenameSubKey_03 |
| 2570 | " |
| 2571 | |
| 2572 | "Created: / 09-04-2019 / 09:39:52 / svestkap" |
| 2573 | ! ! |
| 2574 | |