Skip to content

Commit 2a67685

Browse files
authored
Merge pull request #683 from cgwalters/test-indoc
tests: Use indoc
2 parents 42fe361 + 945b0db commit 2a67685

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ xshell = { version = "0.2.6", optional = true }
4747
uuid = { version = "1.8.0", features = ["v4"] }
4848

4949
[dev-dependencies]
50+
indoc = "2.0.5"
5051
similar-asserts = { version = "1.5.0" }
5152

5253
[features]

lib/src/generator.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,21 @@ fn test_generator_fstab() -> Result<()> {
129129

130130
#[test]
131131
fn test_generator_fstab_idempotent() -> Result<()> {
132-
let anaconda_fstab = "\n\
133-
#\n\
134-
# /etc/fstab\n\
135-
# Created by anaconda on Tue Mar 19 12:24:29 2024\n\
136-
#\n\
137-
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.\n\
138-
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.\n\
139-
#\n\
140-
# After editing this file, run 'systemctl daemon-reload' to update systemd\n\
141-
# units generated from this file.\n\
142-
#\n\
143-
# Updated by bootc-fstab-edit.service\n\
144-
UUID=715be2b7-c458-49f2-acec-b2fdb53d9089 / xfs ro 0 0\n\
145-
UUID=341c4712-54e8-4839-8020-d94073b1dc8b /boot xfs defaults 0 0\n\
146-
";
132+
let anaconda_fstab = indoc::indoc! { "
133+
#
134+
# /etc/fstab
135+
# Created by anaconda on Tue Mar 19 12:24:29 2024
136+
#
137+
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
138+
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
139+
#
140+
# After editing this file, run 'systemctl daemon-reload' to update systemd
141+
# units generated from this file.
142+
#
143+
# Updated by bootc-fstab-edit.service
144+
UUID=715be2b7-c458-49f2-acec-b2fdb53d9089 / xfs ro 0 0
145+
UUID=341c4712-54e8-4839-8020-d94073b1dc8b /boot xfs defaults 0 0
146+
" };
147147
let tempdir = fixture()?;
148148
let unit_dir = &tempdir.open_dir("run/systemd/system")?;
149149

0 commit comments

Comments
 (0)