MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / TestSplitStringNL

Function TestSplitStringNL

internal/util/util_test.go:347–466  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

345}
346
347func TestSplitStringNL(t *testing.T) {
348 type args struct {
349 input string
350 width int
351 prefix []string
352 }
353
354 tests := []struct {
355 name string
356 args args
357 want string
358 }{
359 {
360 "SplitStringNL",
361 args{
362 `This is a sample sentence to be tested.`,
363 10, nil,
364 },
365 `This is a` + "\r\n" +
366 `sample` + "\r\n" +
367 `sentence` + "\r\n" +
368 `to be` + "\r\n" +
369 `tested.`,
370 },
371 {
372 "SplitStringNL punctuation at eol",
373 args{
374 `Hello alex, this is a test.`,
375 10, nil,
376 },
377 `Hello` + "\r\n" +
378 `alex, this` + "\r\n" +
379 `is a test.`,
380 },
381 {
382 "SplitStringNL punctuation at eol 2",
383 args{
384 `Hello alex, this is a test!!!`,
385 10, nil,
386 },
387 `Hello` + "\r\n" +
388 `alex, this` + "\r\n" +
389 `is a` + "\r\n" +
390 `test!!!`,
391 },
392 {
393 "SplitStringNL long text",
394 args{
395 `As your senses attune to the stillness around, you find yourself engulfed in an impenetrable void, ` +
396 `a realm where darkness reigns supreme. ` +
397 `The abyss seems to stretch infinitely in all directions, ` +
398 `and you feel a chilling isolation seeping into your very bones.`,
399 79, nil,
400 },
401 `As your senses attune to the stillness around, you find yourself engulfed in an` + "\r\n" +
402 `impenetrable void, a realm where darkness reigns supreme. The abyss seems to` + "\r\n" +
403 `stretch infinitely in all directions, and you feel a chilling isolation seeping` + "\r\n" +
404 `into your very bones.`,

Callers

nothing calls this directly

Calls 1

SplitStringNLFunction · 0.85

Tested by

no test coverage detected