@@ -102,6 +102,21 @@ func FuzzWrap(f *testing.F) {
102102 }
103103 }
104104 }
105+
106+ // Test with MinimumRaggedness
107+ w .CutLongWords = false
108+ w .MinimumRaggedness = true
109+ result4 := w .Wrap (input , limit )
110+ if ! utf8 .ValidString (result4 ) {
111+ t .Errorf ("result with MinimumRaggedness is not valid UTF-8: %q" , result4 )
112+ }
113+
114+ // Test MinimumRaggedness with CutLongWords
115+ w .CutLongWords = true
116+ result5 := w .Wrap (input , limit )
117+ if ! utf8 .ValidString (result5 ) {
118+ t .Errorf ("result with MinimumRaggedness+CutLongWords is not valid UTF-8: %q" , result5 )
119+ }
105120 })
106121}
107122
@@ -146,18 +161,21 @@ func FuzzWrapWithOptions(f *testing.F) {
146161 t .Errorf ("result is not valid UTF-8: %q" , result )
147162 }
148163
149- // Test all option combinations
164+ // Test all option combinations including MinimumRaggedness
150165 for _ , strip := range []bool {false , true } {
151166 for _ , cut := range []bool {false , true } {
152167 for _ , includeLimit := range []bool {false , true } {
153- w .StripTrailingNewline = strip
154- w .CutLongWords = cut
155- w .LimitIncludesPrefixSuffix = includeLimit
156-
157- result := w .Wrap (input , limit )
158- if ! utf8 .ValidString (result ) {
159- t .Errorf ("result is not valid UTF-8 with strip=%v cut=%v includeLimit=%v: %q" ,
160- strip , cut , includeLimit , result )
168+ for _ , optimal := range []bool {false , true } {
169+ w .StripTrailingNewline = strip
170+ w .CutLongWords = cut
171+ w .LimitIncludesPrefixSuffix = includeLimit
172+ w .MinimumRaggedness = optimal
173+
174+ result := w .Wrap (input , limit )
175+ if ! utf8 .ValidString (result ) {
176+ t .Errorf ("result is not valid UTF-8 with strip=%v cut=%v includeLimit=%v optimal=%v: %q" ,
177+ strip , cut , includeLimit , optimal , result )
178+ }
161179 }
162180 }
163181 }
0 commit comments