From c426fb0530d2339dcd65a5f1273a77330281ccfe Mon Sep 17 00:00:00 2001 From: Steve Winslow Date: Sat, 8 Dec 2018 02:49:19 -0500 Subject: Added tests and implementation to fix idsearcher with long prefix lines Signed-off-by: Steve Winslow --- testdata/project4/has-id-to-ignore.txt | 8 ++++++++ testdata/project4/has-id.txt | 3 +++ testdata/project4/has-mix-of-ids.txt | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 testdata/project4/has-id-to-ignore.txt create mode 100644 testdata/project4/has-id.txt create mode 100644 testdata/project4/has-mix-of-ids.txt (limited to 'testdata') diff --git a/testdata/project4/has-id-to-ignore.txt b/testdata/project4/has-id-to-ignore.txt new file mode 100644 index 0000000..bd63676 --- /dev/null +++ b/testdata/project4/has-id-to-ignore.txt @@ -0,0 +1,8 @@ +this file actually contains some code talking about IDs, and should be ignored + +if file.contains("SPDX-License-Identifier: GPL-2.0") { + // do something... + +} + +We don't want to pick up that line as the short-form ID for this file. diff --git a/testdata/project4/has-id.txt b/testdata/project4/has-id.txt new file mode 100644 index 0000000..5545f2c --- /dev/null +++ b/testdata/project4/has-id.txt @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +somebody was kind enough to stick an spdx short-form ID in here diff --git a/testdata/project4/has-mix-of-ids.txt b/testdata/project4/has-mix-of-ids.txt new file mode 100644 index 0000000..b6aa5d1 --- /dev/null +++ b/testdata/project4/has-mix-of-ids.txt @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT + +the short-form ID above is correct, and should be picked up. + +the following code is talking about IDs, and should be ignored + +if file.contains("SPDX-License-Identifier: GPL-2.0") { + // do something... + +} + +We don't want to pick up that line as the short-form ID for this file. -- cgit v1.2.3