Skip to content

Commit e0cbe52

Browse files
committed
fix: Update detour logic to use asMap() for tag retrieval in WireGuard tests
1 parent f063924 commit e0cbe52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/test/java/io/nekohasekai/sagernet/fmt/ConfigBuilderWireGuardTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ConfigBuilderWireGuardTest {
9191
@Test
9292
fun applicationFacingWireGuardDetoursToNextOutboundInExistingChainOrder() {
9393
val options = topologyOptions()
94-
options.outbounds.single { it.tag == MAIN_TAG }.detourTo(NEXT_TAG)
94+
options.outbounds.single { it.asMap()["tag"] == MAIN_TAG }.detourTo(NEXT_TAG)
9595

9696
val config = finalizedTopology(options)
9797
assertEquals(NEXT_TAG, endpoint(config, MAIN_TAG).get("detour").asString)
@@ -103,7 +103,7 @@ class ConfigBuilderWireGuardTest {
103103
fun egressFacingWireGuardIsReferencedByPreviousOutbound() {
104104
val options = topologyOptions()
105105
options.route.final_ = NEXT_TAG
106-
options.outbounds.single { it.tag == NEXT_TAG }.detourTo(MAIN_TAG)
106+
options.outbounds.single { it.asMap()["tag"] == NEXT_TAG }.detourTo(MAIN_TAG)
107107

108108
val config = finalizedTopology(options)
109109
assertEquals(MAIN_TAG, outbound(config, NEXT_TAG).get("detour").asString)

0 commit comments

Comments
 (0)