Skip to content

Commit 38fa5ba

Browse files
committed
fix: readme code now actually works
1 parent bd9f534 commit 38fa5ba

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ In the coming days, I will release never seen before parsers written in Bash cal
2222
# }
2323

2424
declare -A root_object=()
25-
declare -A zulu_object=([yankee]=)
26-
declare -A yankee_object=([xray]=)
27-
declare -A xray_object=([whiskey]=victor [foxtrot]=)
25+
declare -A zulu_object=()
26+
declare -A yankee_object=()
27+
declare -A xray_object=([whiskey]=victor)
2828
declare -a foxtrot_array=(omicron pi rho sigma)
2929

3030
bobject set-object --pass-by-ref root_object '.zulu' zulu_object
3131
bobject set-object --pass-by-ref root_object '.zulu.yankee' yankee_object
3232
bobject set-object --pass-by-ref root_object '.zulu.yankee.xray' xray_object
33-
bobject set-array root_object '.zulu.yankee.xray.foxtrot' foxtrot_array
33+
bobject set-array --pass-by-ref root_object '.zulu.yankee.xray.foxtrot' foxtrot_array
3434

3535
bobject get-object root_object '.zulu.yankee.xray'
3636
assert [ "${REPLY[whiskey]}" = victor ]
3737

3838
bobject get-string root_object '.zulu.yankee.xray.whiskey'
3939
assert [ "$REPLY" = victor ]
4040

41-
bobject get-array root_object '.zulu.yankee.xray.victor'
42-
assert [ ${#REPLY} -eq 4 ]
41+
bobject get-array root_object '.zulu.yankee.xray.foxtrot'
42+
assert [ ${#REPLY[@]} -eq 4 ]
4343

44-
bobject get-string root_object '.["zulu"].["yankee"].["xray"].["victor"].[2]'
44+
bobject get-string root_object '.["zulu"].["yankee"].["xray"].["foxtrot"].[2]'
4545
assert [ "$REPLY" = rho ]
4646
```
4747

4848
## Installation
4949

50-
STATUS: IN DEVELOPMENT!
50+
STATUS: ALPHA
5151

5252
```sh
5353
echo "dependencies = [ 'hyperupcall/bash-object' ]" > 'bpm.toml'

tests/e2e.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ load './util/init.sh'
8080
}
8181

8282
@test "readme code works" {
83-
declare -A root_object=([zulu=])
84-
declare -A zulu_object=([yankee]=)
85-
declare -A yankee_object=([xray]=)
86-
declare -A xray_object=([whiskey]=victor [foxtrot]=)
83+
declare -A root_object=()
84+
declare -A zulu_object=()
85+
declare -A yankee_object=()
86+
declare -A xray_object=([whiskey]=victor)
8787
declare -a foxtrot_array=(omicron pi rho sigma)
8888

8989
bobject set-object --pass-by-ref root_object '.zulu' zulu_object
@@ -97,9 +97,9 @@ load './util/init.sh'
9797
bobject get-string root_object '.zulu.yankee.xray.whiskey'
9898
assert [ "$REPLY" = victor ]
9999

100-
bobject get-array root_object '.zulu.yankee.xray.victor'
101-
assert [ ${#REPLY} -eq 4 ]
100+
bobject get-array root_object '.zulu.yankee.xray.foxtrot'
101+
assert [ ${#REPLY[@]} -eq 4 ]
102102

103-
bobject get-string root_object '.["zulu"].["yankee"].["xray"].["victor"].[2]'
103+
bobject get-string root_object '.["zulu"].["yankee"].["xray"].["foxtrot"].[2]'
104104
assert [ "$REPLY" = rho ]
105105
}

0 commit comments

Comments
 (0)