-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from Nukesor/fix-overflow
Fix overflow in several places
- Loading branch information
Showing
6 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use comfy_table::*; | ||
|
||
/// A gigantic table can generated, even if it's longer than the longest supported width. | ||
#[test] | ||
fn giant_table() { | ||
let mut table = Table::new(); | ||
table.set_header(["a".repeat(1_000_000)]); | ||
table.add_row(["a".repeat(1_000_000)]); | ||
|
||
table.to_string(); | ||
} | ||
|
||
/// No panic, even if there's a ridiculous amount of padding. | ||
#[test] | ||
fn max_padding() { | ||
let mut table = Table::new(); | ||
table.add_row(["test"]); | ||
let column = table.column_mut(0).unwrap(); | ||
|
||
column.set_padding((u16::MAX, u16::MAX)); | ||
|
||
table.to_string(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters