Skip to content

Commit 467c139

Browse files
committed
Test: checkIndexOverflow is now skipped with its internal package; check @PublishedApi declines elsewhere
B-11 is implemented. Refs #192
1 parent 0ef75a4 commit 467c139

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎docs/SPEC.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ All in `PM/commonTest`, so they run wherever the interpreter loads.
482482
`DeclarationModel` either: it is not part of the library's surface. The rule is a blacklist (decision 12.7
483483
in `AGENTS.md`): everything else that is public stays bound; it is not a list of what to expose. A segment
484484
must equal `internal` exactly (`internals` and `internal_api` are ordinary packages).
485-
`Status: planned`, `GP/artifact/InternalPackageExclusionTest.kt`.
485+
`Status: implemented`, `GP/artifact/InternalPackageExclusionTest.kt`.
486486

487487
## 7. Threading and builds
488488

‎python-multiplatform-gradle-plugin/src/test/kotlin/python/multiplatform/gradle/artifact/KlibScannerTest.kt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ class KlibScannerTest {
151151
@Test
152152
fun aPublishedApiInternalDeclarationIsDeclinedWithItsOwnReason() {
153153
val declarations = KlibScanner.scanKlibDeclarations(coroutinesKlib, includePrefixes = emptyList())
154-
val checkIndexOverflow = declarations.single { it.simpleName == "checkIndexOverflow" }
155-
assertEquals(null, checkIndexOverflow.bindingName)
156-
assertTrue(
157-
checkIndexOverflow.declineReason?.contains("PublishedApi") == true,
158-
"expected a @PublishedApi decline reason, got ${checkIndexOverflow.declineReason}",
159-
)
154+
// checkIndexOverflow lives in kotlinx.coroutines.internal, which B-11 (#192) skips outright:
155+
// it gets no model at all, so the @PublishedApi reason is checked on declarations elsewhere.
156+
assertTrue(declarations.none { it.simpleName == "checkIndexOverflow" })
157+
val publishedApi = declarations.filter { it.declineReason?.contains("PublishedApi") == true }
158+
assertTrue(publishedApi.isNotEmpty(), "expected a @PublishedApi decline outside internal packages")
159+
assertTrue(publishedApi.all { it.bindingName == null })
160160
}
161161

162162
/**

0 commit comments

Comments
 (0)