Skip to content

Commit d1d0a3d

Browse files
committed
chore(common-utils): Split tests into matching files
In 6d34ce5 the implementations were split across multiple files, but the tests were forgotten. Make good for that now. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 4fb3131 commit d1d0a3d

File tree

8 files changed

+691
-582
lines changed

8 files changed

+691
-582
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2017 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* SPDX-License-Identifier: Apache-2.0
17+
* License-Filename: LICENSE
18+
*/
19+
20+
package org.ossreviewtoolkit.utils.common
21+
22+
import io.kotest.core.spec.style.WordSpec
23+
import io.kotest.matchers.collections.beEmpty
24+
import io.kotest.matchers.should
25+
import io.kotest.matchers.shouldBe
26+
27+
import java.time.DayOfWeek
28+
29+
class EnumUtilsTest : WordSpec({
30+
"The plus operator" should {
31+
"create an empty set if both summands are empty" {
32+
val sum = enumSetOf<DayOfWeek>() + enumSetOf()
33+
34+
sum should beEmpty()
35+
}
36+
37+
"create the correct sum of two sets" {
38+
val sum = enumSetOf(DayOfWeek.MONDAY, DayOfWeek.TUESDAY) + enumSetOf(DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY)
39+
40+
sum shouldBe enumSetOf(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY)
41+
}
42+
}
43+
})

0 commit comments

Comments
 (0)