Ticket #269: regression_fix_1_of_1_rev_ba58ef8a6214_Issue__269__Tests_when_renaming_registy_subKey_s_.patch

File regression_fix_1_of_1_rev_ba58ef8a6214_Issue__269__Tests_when_renaming_registy_subKey_s_.patch, 2.9 KB (added by patrik.svestka@…, 5 years ago)

tests

  • RegressionTests__Win32OperatingSystemTest.st

    # HG changeset patch
    # User Patrik Svestka <patrik.svestka@gmail.com>
    # Date 1554801508 -7200
    #      Tue Apr 09 11:18:28 2019 +0200
    # Branch jv
    # Node ID ba58ef8a6214c0dd1650b5d4da60e042e48f1efe
    # Parent  aecb2604da9c72d224c07684fda9705f770ecbf1
    Issue #269: Tests when renaming registy subKey(s)
    
    diff -r aecb2604da9c -r ba58ef8a6214 RegressionTests__Win32OperatingSystemTest.st
    a b  
    25052505    "Modified (format): / 01-02-2019 / 13:32:02 / svestkap"
    25062506! !
    25072507
     2508!Win32OperatingSystemTest methodsFor:'tests-unicodeRename'!
     2509
     2510testRenameSubKey_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
     2530testRenameSubKey_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
     2556testRenameSubKey_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
    25082575!Win32OperatingSystemTest methodsFor:'tests-unicodeWrite'!
    25092576
    25102577testDefaultValue_01