From ce5dc54cd42f980a6ee050d5c1399ae3faadf0e4 Mon Sep 17 00:00:00 2001 From: rhysd Date: Tue, 4 Oct 2022 17:58:18 +0900 Subject: [PATCH] add regression test case for #4 --- tests/history.rs | 10 ++++++++++ tests/mod.rs | 1 + 2 files changed, 11 insertions(+) create mode 100644 tests/history.rs diff --git a/tests/history.rs b/tests/history.rs new file mode 100644 index 0000000..b1ab010 --- /dev/null +++ b/tests/history.rs @@ -0,0 +1,10 @@ +use tui_textarea::TextArea; + +// Regression test for #4 +#[test] +fn disable_history() { + let mut t = TextArea::default(); + t.set_max_histories(0); + assert!(t.insert_str("hello")); + assert_eq!(t.lines(), ["hello"]); +} diff --git a/tests/mod.rs b/tests/mod.rs index 0e02b79..d010018 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -1 +1,2 @@ mod cursor; +mod history;