You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+116-4Lines changed: 116 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Standardized INI Table Format
32
32
--------------------------
33
33
Next is to standardize the INI to a common syntax format:
34
34
```
35
-
[section]keyword=keyvale
35
+
[section]keyword=keyvalue
36
36
```
37
37
38
38
An example INI file might look like this:
@@ -58,9 +58,9 @@ Parsable AWK/SED/GREP Galore!
58
58
With a common `[section]keyword=keyvalue`, it now becomes possible to work with INI line-records in a faster manner using `sed`, `awk` and `tail`.
59
59
60
60
61
-
How To Use bash-ini-file
61
+
How To Use bash-ini-parser
62
62
====
63
-
Simply source the lone script file: `bash-ini-file.sh`
63
+
Simply source the lone script file: `bash-ini-parser.sh`
64
64
and start calling APIs such as:
65
65
66
66
| API |`$?`|`STDOUT`| Description |
@@ -129,7 +129,119 @@ Done.
129
129
130
130
Unit Test
131
131
=========
132
-
`tests` subdirectory performs the comprehensive unit test, in case you tweaked it, this will find any errors of yours.
132
+
The accompanied `tests` subdirectory performs the comprehensive unit testing, in case you have decided to tweaked it to your normative scenario; hopefully, this will find any errors of yours.
133
+
134
+
To exercise the test, your modified `bash-ini-parser.sh must reside above the `tests` directory as all the unit tests will perform:
135
+
136
+
```bash
137
+
#!/bin/bash
138
+
# Title: my script file
139
+
140
+
source ../bash-ini-parser.sh
141
+
142
+
...
143
+
```
144
+
145
+
Supreme Unit Testing
146
+
---
147
+
To start the global unit test, execute:
148
+
149
+
```bash
150
+
cd tests
151
+
./test-all.sh
152
+
```
153
+
and the output is long, very long, very very long.
154
+
155
+
Selective Unit Test
156
+
---
157
+
158
+
To perform a specific unit test, for example, `ini_keyvalue_get()`, execute:
159
+
160
+
```console
161
+
$ bash test-ini-keyvalue-get.sh
162
+
assert_keyvalue_get([Default]DNS=): pass # same keyword, 'Default' section
163
+
assert_keyvalue_get([Resolve]DNS=): pass # same keyword, 'Resolve' section
0 commit comments