2021-03-19 17:42:26 +08:00
|
|
|
package com.geeksville.mesh.model
|
|
|
|
|
|
|
|
|
|
import android.net.Uri
|
|
|
|
|
import org.junit.Assert
|
|
|
|
|
import org.junit.Test
|
|
|
|
|
|
|
|
|
|
class ChannelSetTest {
|
|
|
|
|
/** make sure we match the python and device code behavior */
|
|
|
|
|
@Test
|
|
|
|
|
fun matchPython() {
|
2022-02-15 23:50:27 -03:00
|
|
|
val url = Uri.parse("https://www.meshtastic.org/d/#CgUYAiIBAQ")
|
2021-03-19 17:42:26 +08:00
|
|
|
val cs = ChannelSet(url)
|
2022-02-15 23:50:27 -03:00
|
|
|
Assert.assertEquals("LongFast", cs.primaryChannel!!.name, )
|
|
|
|
|
Assert.assertEquals("#LongFast-I", cs.primaryChannel!!.humanName, )
|
2021-03-19 21:27:41 +08:00
|
|
|
Assert.assertEquals(url, cs.getChannelUrl(false))
|
2021-03-19 17:42:26 +08:00
|
|
|
}
|
2022-02-15 23:50:27 -03:00
|
|
|
}
|