feat: make to nuon raw option remove all white space (#15609)

# Description
Fixes #9942

This adds a new `--minified` flag to `to nuon` which removes all
possible white space. I added an example test to demonstrate the
functionality.

# User-Facing Changes

New flag becomes available to the user.
This commit is contained in:
Artem Chernyak
2025-05-09 01:38:24 +00:00
committed by GitHub
parent 52fa9a978b
commit 73fbe26ef9
12 changed files with 57 additions and 34 deletions

View File

@ -96,8 +96,8 @@ export def equal [left: any, right: any, message?: string] {
}
text: (
"These are not equal.\n"
+ $" Left : '($left | to nuon --raw)'\n"
+ $" Right : '($right | to nuon --raw)'"
+ $" Left : '($left | to nuon)'\n"
+ $" Right : '($right | to nuon)'"
)
}
}
@ -114,7 +114,7 @@ export def "not equal" [left: any, right: any, message?: string] {
start: (metadata $left).span.start
end: (metadata $right).span.end
}
text: $"These are both '($left | to nuon --raw)'."
text: $"These are both '($left | to nuon)'."
}
}
@ -210,7 +210,7 @@ export def length [left: list, right: int, message?: string] {
}
text: (
"This does not have the correct length:\n"
+ $" value : ($left | to nuon --raw)\n"
+ $" value : ($left | to nuon)\n"
+ $" length : ($left | core length)\n"
+ $" expected : ($right)"
)
@ -231,7 +231,7 @@ export def "str contains" [left: string, right: string, message?: string] {
}
text: (
$"This does not contain '($right)'.\n"
+ $" value: ($left | to nuon --raw)"
+ $" value: ($left | to nuon)"
)
}
}