2015-11-16 05:25:01 +00:00
|
|
|
use common::util::*;
|
|
|
|
|
|
|
|
static UTIL_NAME: &'static str = "fold";
|
2016-07-29 21:26:32 +00:00
|
|
|
fn new_ucmd() -> UCommand {
|
|
|
|
TestScenario::new(UTIL_NAME).ucmd()
|
|
|
|
}
|
2015-11-16 05:25:01 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_default_80_column_wrap() {
|
2016-07-29 21:26:32 +00:00
|
|
|
new_ucmd()
|
|
|
|
.arg("lorem_ipsum.txt")
|
|
|
|
.run()
|
|
|
|
.stdout_is_fixture("lorem_ipsum_80_column.expected");
|
2015-11-16 05:25:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_40_column_hard_cutoff() {
|
2016-07-29 21:26:32 +00:00
|
|
|
new_ucmd()
|
2016-08-13 21:59:21 +00:00
|
|
|
.args(&["-w", "40", "lorem_ipsum.txt"])
|
2016-07-29 21:26:32 +00:00
|
|
|
.run()
|
|
|
|
.stdout_is_fixture("lorem_ipsum_40_column_hard.expected");
|
2015-11-16 05:25:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_40_column_word_boundary() {
|
2016-07-29 21:26:32 +00:00
|
|
|
new_ucmd()
|
2016-08-13 21:59:21 +00:00
|
|
|
.args(&["-s", "-w", "40", "lorem_ipsum.txt"])
|
2016-07-29 21:26:32 +00:00
|
|
|
.run()
|
|
|
|
.stdout_is_fixture("lorem_ipsum_40_column_word.expected");
|
2015-11-16 05:25:01 +00:00
|
|
|
}
|