Skip to content

Commit

Permalink
xtask: Obfuscate SPDX tags in xtask code
Browse files Browse the repository at this point in the history
... to stop the reuse tool from getting confused.
  • Loading branch information
hunger committed Jan 19, 2022
1 parent a55f4a1 commit a2da193
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions xtask/src/license_headers_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ fn test_license_tag_c_style() {
let source = format!(
r#"// Copyright © something <[email protected]>
foobar
// SPDX-License-Identifier: {}
// SP{}-License-Identifier: {}
blah"#,
EXPECTED_SPDX_EXPRESSION
"DX", EXPECTED_SPDX_EXPRESSION
);
let test_source = SourceFileWithTags::new(&source, &style);
assert_eq!(
Expand All @@ -142,10 +142,10 @@ blah"#
let source = format!(
r#"// Copyright © something <[email protected]>
foobar
// SPDX-License-Identifier: {}
// SP{}-License-Identifier: {}
blah"#,
EXPECTED_SPDX_EXPRESSION
"DX", EXPECTED_SPDX_EXPRESSION
);
let test_source = SourceFileWithTags::new(&source, &style);
assert_eq!(
Expand Down Expand Up @@ -194,10 +194,10 @@ fn test_license_tag_hash() {
let source = format!(
r#"# Copyright © something <[email protected]>
foobar
# SPDX-License-Identifier: {}
# SP{}-License-Identifier: {}
blah"#,
EXPECTED_SPDX_EXPRESSION
"DX", EXPECTED_SPDX_EXPRESSION
);
let test_source = SourceFileWithTags::new(&source, &style);
assert_eq!(
Expand Down Expand Up @@ -227,10 +227,10 @@ fn test_license_tag_dotdot() {
let source = format!(
r#".. Copyright © something <[email protected]>
foobar
.. SPDX-License-Identifier: {}
.. SP{}-License-Identifier: {}
blah"#,
EXPECTED_SPDX_EXPRESSION
"DX", EXPECTED_SPDX_EXPRESSION
);
let test_source = SourceFileWithTags::new(&source, &style);
assert_eq!(
Expand Down Expand Up @@ -338,7 +338,7 @@ impl<'a> LicenseHeader<'a> {

const EXPECTED_SPDX_EXPRESSION: &str = "(GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)";
const EXPECTED_SPDX_ID: &str =
const_format::concatcp!("SPDX-License-Identifier: ", EXPECTED_SPDX_EXPRESSION);
const_format::concatcp!("SP", "DX-License-Identifier: ", EXPECTED_SPDX_EXPRESSION); // Do not confuse the reuse tool

const EXPECTED_HEADER: LicenseHeader<'static> =
LicenseHeader(&["Copyright © SixtyFPS GmbH <[email protected]>", EXPECTED_SPDX_ID]);
Expand Down

0 comments on commit a2da193

Please sign in to comment.