Commit 8972167
🩹 [Patch]: Adjust GitHubRepository format to show aligned sizes (#507)
This pull request updates the file size formatting logic in
`GitHubFormatter` to ensure consistent output with two decimal places
for all units, including bytes, and adjusts the related tests to match
the new output format. The most important changes are grouped below:
- Fixes #506
File size formatting improvements:
* Modified `FormatFileSize` in `GitHubFormatter.ps1` to always display
byte values with two decimal places (e.g., "0.00 B" instead of "0 B").
Test updates for new formatting:
* Updated test cases in `GitHubFormatter.Tests.ps1` to expect
two-decimal formatting for bytes and adjusted regex patterns to match
the new output (e.g., `\d+[.,]\d{2}\s{2}B`).
* Refactored the test to directly validate the output of the formatter
against the new expected patterns, ensuring the tests accurately reflect
the updated formatting logic.
* Removed outdated comments and redundant test setup to streamline and
clarify the test file.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>1 parent 8ef51f0 commit 8972167
File tree
2 files changed
+14
-22
lines changed- src/classes/public
- tests
2 files changed
+14
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
61 | 53 | | |
62 | 54 | | |
63 | 55 | | |
| |||
0 commit comments