Skip to content

Commit

Permalink
test: add test (shouldn't overflow when coloring already colored larg…
Browse files Browse the repository at this point in the history
…e text)
  • Loading branch information
Henry-Hong committed Jul 21, 2024
1 parent 1d7a86d commit 8ebc6e6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ test("non-string input", () => {
assert.equal(pc.red(Infinity), FMT.red[0] + "Infinity" + FMT.red[1])
})

test("shouldn't overflow when coloring already colored large text", () => {
try {
pc.blue(pc.red("x").repeat(10000))
assert(true)
} catch {
assert(false)
}
})

function test(name, fn) {
try {
fn()
Expand Down

0 comments on commit 8ebc6e6

Please sign in to comment.