Support some lbry hosts to deep links. Add unit tests #1008

Merged
kekkyojin merged 3 commits from more-deeplinks into master 2020-10-02 13:34:39 +02:00
Showing only changes of commit 750cc4fb77 - Show all commits

View file

@ -81,4 +81,28 @@ public class LbryUriTest {
assertEquals(expected, obtained); assertEquals(expected, obtained);
} }
@Test
public void parseLbryProtocolOnlyChannel() {
LbryUri expectedForChannel = new LbryUri();
expectedForChannel.setChannelName("@UCBerkeley");
expectedForChannel.setChannel(true);
try {
LbryUri.UriModifier primaryMod = LbryUri.UriModifier.parse("#", "d");
expectedForChannel.setChannelClaimId(primaryMod.getClaimId());
} catch (LbryUriException e) {
e.printStackTrace();
}
LbryUri obtained = new LbryUri();
try {
obtained = LbryUri.parse("lbry://@UCBerkeley#d",false);
} catch (LbryUriException e) {
e.printStackTrace();
}
assertEquals(expectedForChannel, obtained);
}
} }