Skip to content

Commit 64cd386

Browse files
committed
test: parameterize channel URL import coverage
1 parent 31c99e4 commit 64cd386

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

MeshtasticTests/MeshtasticChannelURLTests.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@ struct MeshtasticChannelURLTests {
3838
#expect(!add.channelSet.hasLoraConfig)
3939
}
4040

41-
@Test func allSupportedChannelCountsPreserveSettingsForReplaceAndAdd() throws {
42-
for channelCount in 1 ... 8 {
43-
let channelSet = makeChannelSet(channelCount: channelCount)
44-
let replace = try MeshtasticChannelURL.parse(MeshtasticChannelURL.urlString(for: channelSet))
45-
let add = try MeshtasticChannelURL.parse(MeshtasticChannelURL.urlString(for: channelSet, addChannels: true))
46-
47-
#expect(replace.channelSet.settings == channelSet.settings, "\(channelCount)-channel replace settings")
48-
#expect(replace.channelSet.loraConfig == channelSet.loraConfig, "\(channelCount)-channel replace LoRa config")
49-
#expect(add.channelSet.settings == channelSet.settings, "\(channelCount)-channel add settings")
50-
#expect(!add.channelSet.hasLoraConfig, "\(channelCount)-channel add must not retune")
51-
}
41+
@Test(arguments: 1 ... 8)
42+
func allSupportedChannelCountsPreserveSettingsForReplaceAndAdd(channelCount: Int) throws {
43+
let channelSet = makeChannelSet(channelCount: channelCount)
44+
let replace = try MeshtasticChannelURL.parse(MeshtasticChannelURL.urlString(for: channelSet))
45+
let add = try MeshtasticChannelURL.parse(MeshtasticChannelURL.urlString(for: channelSet, addChannels: true))
46+
47+
#expect(replace.channelSet.settings == channelSet.settings, "\(channelCount)-channel replace settings")
48+
#expect(replace.channelSet.loraConfig == channelSet.loraConfig, "\(channelCount)-channel replace LoRa config")
49+
#expect(add.channelSet.settings == channelSet.settings, "\(channelCount)-channel add settings")
50+
#expect(!add.channelSet.hasLoraConfig, "\(channelCount)-channel add must not retune")
5251
}
5352

5453
@Test(arguments: [

0 commit comments

Comments
 (0)