| 1 |
Description: New shfmt does not accept empty while loop. Fix the same. |
| 2 |
Author: Nilesh Patra <[email protected]> |
| 3 |
Last-Update: 2026-07-31 |
| 4 |
--- a/shsprintf/shsprintf_test.go |
| 5 |
+++ b/shsprintf/shsprintf_test.go |
| 6 |
@@ -93,7 +93,7 @@ |
| 7 |
format: `#! /bin/bash |
| 8 |
end=$((SECONDS+%d)) |
| 9 |
|
| 10 |
|
| 11 |
+while [ $SECONDS -lt $end ]; do true |
| 12 |
done`, |
| 13 |
replacements: []any{ |
| 14 |
3, |
| 15 |
--- a/shtemplate/shtemplate_test.go |
| 16 |
+++ b/shtemplate/shtemplate_test.go |
| 17 |
@@ -67,7 +67,7 @@ |
| 18 |
tmplText: `#! /bin/bash |
| 19 |
end=$((SECONDS+{{.wait}})) |
| 20 |
|
| 21 |
|
| 22 |
+while [ $SECONDS -lt $end ]; do true |
| 23 |
done`, |
| 24 |
replacements: map[any]any{ |
| 25 |
"wait": 3, |
| 26 |
@@ -136,7 +136,7 @@ |
| 27 |
{ |
| 28 |
tmplText: "echo $(({{ (StructuralData .addressee) }}))", |
| 29 |
replacements: map[any]any{ |
| 30 |
|
| 31 |
+ "addressee": "test", |
| 32 |
}, |
| 33 |
err: nil, |
| 34 |
}, |