diff --git a/hawkeye-core/src/test/data/issue-113/.gitignore b/hawkeye-core/src/test/data/issue-113/.gitignore new file mode 100644 index 0000000..ea7134a --- /dev/null +++ b/hawkeye-core/src/test/data/issue-113/.gitignore @@ -0,0 +1 @@ +main.rs.formatted diff --git a/hawkeye-core/src/test/data/issue-113/licenserc.toml b/hawkeye-core/src/test/data/issue-113/licenserc.toml new file mode 100644 index 0000000..0c47281 --- /dev/null +++ b/hawkeye-core/src/test/data/issue-113/licenserc.toml @@ -0,0 +1,17 @@ +baseDir = "src/test/data/issue-113" + +inlineHeader = """ +${hawkeye.core.filename} +------------------------------------------ +Copyright (c) ${year} +${owner} +------------------------------------------ +""" + +includes = [ + "*.rs", +] + +[properties] +year = 2024 +owner = "Some_Name" diff --git a/hawkeye-core/src/test/data/issue-113/main.rs b/hawkeye-core/src/test/data/issue-113/main.rs new file mode 100644 index 0000000..e14e4c0 --- /dev/null +++ b/hawkeye-core/src/test/data/issue-113/main.rs @@ -0,0 +1 @@ +use macros::define_result; diff --git a/hawkeye-core/src/test/data/issue-113/main.rs.formatted.expected b/hawkeye-core/src/test/data/issue-113/main.rs.formatted.expected new file mode 100644 index 0000000..0934e3b --- /dev/null +++ b/hawkeye-core/src/test/data/issue-113/main.rs.formatted.expected @@ -0,0 +1,7 @@ +// main.rs +// ------------------------------------------ +// Copyright (c) 2024 +// Some_Name +// ------------------------------------------ + +use macros::define_result; diff --git a/hawkeye-core/src/test/java/io/korandoru/hawkeye/core/RegressionTest.java b/hawkeye-core/src/test/java/io/korandoru/hawkeye/core/RegressionTest.java index 51a7c01..0bea04a 100644 --- a/hawkeye-core/src/test/java/io/korandoru/hawkeye/core/RegressionTest.java +++ b/hawkeye-core/src/test/java/io/korandoru/hawkeye/core/RegressionTest.java @@ -33,4 +33,16 @@ void testIssue110() { final File actual = new File("src/test/data/issue-110/main.rs.formatted"); assertThat(actual).hasSameTextualContentAs(expected); } + + @Test + void testIssue113() { + final File file = new File("src/test/data/issue-113/licenserc.toml"); + final HawkEyeConfig config = HawkEyeConfig.of(file).dryRun(true).build(); + final LicenseFormatter formatter = new LicenseFormatter(config); + formatter.call(); + + final File expected = new File("src/test/data/issue-113/main.rs.formatted.expected"); + final File actual = new File("src/test/data/issue-113/main.rs.formatted"); + assertThat(actual).hasSameTextualContentAs(expected); + } }