Skip to content

Doesn't wrap correctly with whitespaces near the border #3

Open
AnAppAMonth opened this Issue Aug 9, 2013 · 1 comment

1 participant

@AnAppAMonth

Test Cases

// Expected: "I love u\n\n\n"
// Actual:   "I love\nu\n\n\n"
wordwrap(10)("I love u\n\n\n");

// Expected: "I hug you,\nmy friend"
// Actual:   "I hug\nyou, my\nfriend"
wordwrap(10)('I hug you, my friend');

// Expected: "I love u\n\n\n"
// Actual:   "I love u\n\n\n\n"
wordwrap.hard(10)("I love u\n\n\n");

// Expected: "I hug you,\nmy friend"
// Actual:   "I hug you\n, my\nfriend"
wordwrap.hard(10)('I hug you, my friend');

// Expected: "12345678910"
// Actual:   "\n12345678910"
wordwrap(10)("12345678910");

// Expected: " \n 12345678910\n "
// Actual:   " \n\n 12345678910\n "
wordwrap(1, 11)("\n12345678910\n");
@AnAppAMonth AnAppAMonth added a commit to AnAppAMonth/node-wordwrap that referenced this issue Aug 9, 2013
@AnAppAMonth AnAppAMonth Fix several bugs listed in Issue #3 5beacdd
@AnAppAMonth

I have created a pull request #4 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.