mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
parent
ffbfdabb3a
commit
c5b527f450
2 changed files with 27 additions and 10 deletions
|
|
@ -466,6 +466,25 @@ class MediaDetailFragmentUnitTests {
|
|||
Assert.assertEquals(map, method.invoke(fragment, s))
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetDescriptionsWithLongSpaces() {
|
||||
`when`(media.filename).thenReturn("")
|
||||
val method: Method = MediaDetailFragment::class.java.getDeclaredMethod("getDescriptions", String::class.java)
|
||||
method.isAccessible = true
|
||||
val s = "=={{int:filedesc}}==\n" +
|
||||
"{{Information\n" +
|
||||
"|Description ={{en|1=The interior of Sacred Heart RC Church, Wimbledon, London.}}\n" +
|
||||
"|Source ={{own}}\n" +
|
||||
"|Author =[[User:Diliff|Diliff]]\n" +
|
||||
"|Date =2015-02-17\n" +
|
||||
"|Permission ={{Diliff/Licensing}}\n" +
|
||||
"|other_versions=\n" +
|
||||
"}}"
|
||||
val map = linkedMapOf("en" to "The interior of Sacred Heart RC Church, Wimbledon, London.")
|
||||
Assert.assertEquals(map, method.invoke(fragment, s))
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testGetDescriptionList() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue