Commit 8a6a88c
authored
🩹 [Patch]: Handle empty hashtable in
## Description
This pull request includes changes to the `Format-Hashtable` function
and its corresponding tests to handle empty hashtables correctly. The
most important changes are as follows:
Improvements to `Format-Hashtable` function:
*
[`src/functions/public/Format-Hashtable.ps1`](diffhunk://#diff-7d90dfc5bc21b6d23ceed48105316975686cabff108964a18fa84407c1429f87R68-R72):
Added a check to return '@{}' immediately if the hashtable is empty.
Enhancements to tests:
*
[`tests/Hashtable.Tests.ps1`](diffhunk://#diff-0d9a4623edf86d4025f7602749bc2c1397bec49ddcbb1fa7b51fe34634049687R258-R267):
Added a new test context to ensure that the `Format-Hashtable` function
returns an empty hashtable string when given an empty hashtable.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] Format-Hashtable function (#5)1 parent 63c76f7 commit 8a6a88c
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
258 | 268 | | |
259 | 269 | | |
260 | 270 | | |
261 | 271 | | |
262 | 272 | | |
| 273 | + | |
263 | 274 | | |
264 | 275 | | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
| 279 | + | |
268 | 280 | | |
269 | 281 | | |
270 | 282 | | |
| |||
0 commit comments