From aa6f6f47cd7f83e3898b66e53ff30a414b0a0694 Mon Sep 17 00:00:00 2001
From: Guillaume Gomez <guillaume.gomez@huawei.com>
Date: Sat, 6 Nov 2021 19:42:43 +0100
Subject: [PATCH] Add test for removed one character last line in rustdoc

---
 src/test/rustdoc/include_str_cut.rs | 7 +++++++
 src/test/rustdoc/short-line.md      | 2 ++
 2 files changed, 9 insertions(+)
 create mode 100644 src/test/rustdoc/include_str_cut.rs
 create mode 100644 src/test/rustdoc/short-line.md

diff --git a/src/test/rustdoc/include_str_cut.rs b/src/test/rustdoc/include_str_cut.rs
new file mode 100644
index 000000000000..cbc1ba8db752
--- /dev/null
+++ b/src/test/rustdoc/include_str_cut.rs
@@ -0,0 +1,7 @@
+#![crate_name = "foo"]
+#![no_std]
+
+// @has 'foo/fn.foo.html'
+// @has - '//*[@class="docblock"]' 'inc2 x'
+#[doc = include_str!("short-line.md")]
+pub fn foo() {}
diff --git a/src/test/rustdoc/short-line.md b/src/test/rustdoc/short-line.md
new file mode 100644
index 000000000000..eff713baac4a
--- /dev/null
+++ b/src/test/rustdoc/short-line.md
@@ -0,0 +1,2 @@
+inc2
+x