mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-10-04 11:08:19 +00:00
* makes changes to almost all main repo files to be in accordance with .editorconfig * some files in "test\fixtures\..." were left alone to avoid breaking tests * NOTE: whitespace changes *only* (`git diff -b` shows no changes)
18 lines
496 B
PowerShell
18 lines
496 B
PowerShell
. "$psscriptroot\..\lib\core.ps1"
|
|
. "$psscriptroot\..\lib\config.ps1"
|
|
|
|
describe "hashtable" {
|
|
$json = '{ "one": 1, "two": [ { "a": "a" }, "b", 2 ], "three": { "four": 4 } }'
|
|
|
|
it "converts pscustomobject to hashtable" {
|
|
$obj = convertfrom-json $json
|
|
$ht = hashtable $obj
|
|
|
|
$ht.one | should beexactly 1
|
|
$ht.two[0].a | should be "a"
|
|
$ht.two[1] | should be "b"
|
|
$ht.two[2] | should beexactly 2
|
|
$ht.three.four | should beexactly 4
|
|
}
|
|
}
|