Skip to content

Commit 499ea03

Browse files
committed
add tests to verify we generated the expected types
1 parent afc0c5a commit 499ea03

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2025 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
package com.example.swift;
16+
17+
import org.junit.jupiter.api.Test;
18+
import org.swift.swiftkit.core.*;
19+
import org.swift.swiftkit.ffm.*;
20+
21+
import java.lang.foreign.Arena;
22+
import java.util.Optional;
23+
import java.util.OptionalInt;
24+
25+
import static org.junit.jupiter.api.Assertions.*;
26+
27+
public class MultipleTypesFromSingleFileTest {
28+
29+
@Test
30+
void bothTypesMustHaveBeenGenerated() {
31+
try (var arena = AllocatingSwiftArena.ofConfined()) {
32+
PublicTypeOne.init(arena);
33+
PublicTypeTwo.init(arena);
34+
}
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2025 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
package com.example.swift;
16+
17+
import org.junit.jupiter.api.Test;
18+
import org.swift.swiftkit.core.ConfinedSwiftMemorySession;
19+
import org.swift.swiftkit.core.SwiftArena;
20+
21+
import java.lang.foreign.Arena;
22+
import java.util.Optional;
23+
import java.util.OptionalInt;
24+
25+
import static org.junit.jupiter.api.Assertions.*;
26+
27+
public class MultipleTypesFromSingleFileTest {
28+
29+
@Test
30+
void bothTypesMustHaveBeenGenerated() {
31+
try (var arena = SwiftArena.ofConfined()) {
32+
PublicTypeOne.init(arena);
33+
PublicTypeTwo.init(arena);
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)