diff options
author | Steve Winslow <swinslow@gmail.com> | 2018-12-08 02:49:19 -0500 |
---|---|---|
committer | Steve Winslow <swinslow@gmail.com> | 2018-12-08 02:49:19 -0500 |
commit | c426fb0530d2339dcd65a5f1273a77330281ccfe (patch) | |
tree | 091be83b07f58186508c2c5f21b939ebd8b71c7c /testdata | |
parent | b7ba1c5e88bf4fecc99d5c1b7eaa8181b1b812ef (diff) | |
download | spdx-tools-c426fb0530d2339dcd65a5f1273a77330281ccfe.tar.gz |
Added tests and implementation to fix idsearcher with long prefix lines
Signed-off-by: Steve Winslow <swinslow@gmail.com>
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/project4/has-id-to-ignore.txt | 8 | ||||
-rw-r--r-- | testdata/project4/has-id.txt | 3 | ||||
-rw-r--r-- | testdata/project4/has-mix-of-ids.txt | 12 |
3 files changed, 23 insertions, 0 deletions
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. |