Skip to content

Commit 2e8ad65

Browse files
committed
Change PasteDetails#date type to ULong
1 parent e6441eb commit 2e8ad65

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/commonMain/kotlin/net/pearx/kpastebin/model/PasteDetails.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import net.pearx.kpastebin.internal.XML_PROPERTY_REGEX
1616
public data class PasteDetails(
1717
/** Paste key. */
1818
val key: String,
19-
/** Paste publication date. */
20-
val date: Int,
19+
/** Paste publication date in Unix time format. */
20+
val date: ULong,
2121
/** Paste title. */
2222
val title: String,
2323
/** Paste size in bytes. */
@@ -44,7 +44,7 @@ public data class PasteDetails(
4444
val map = XML_PROPERTY_REGEX.findAll(paste.groupValues[2]).associate { it.groupValues[1].substring(6) to it.groupValues[2] } // .substring(6) is here to cut the 'paste_' part of each property.
4545
lst.add(PasteDetails(
4646
map.getValue("key"),
47-
map.getValue("date").toInt(),
47+
map.getValue("date").toULong(),
4848
map.getValue("title"),
4949
map.getValue("size").toInt(),
5050
map.getValue("expire_date").toULong(),

src/commonTest/kotlin/net/pearx/kpastebin/test/LoggedInTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class LoggedInTest {
3535
assertEquals(listOf(
3636
PasteDetails(
3737
"0b42rwhf",
38-
1297953260,
38+
1297953260UL,
3939
"javascript test",
4040
15,
4141
1297956860UL,
@@ -47,7 +47,7 @@ class LoggedInTest {
4747
),
4848
PasteDetails(
4949
"0C343n0d",
50-
1297694343,
50+
1297694343UL,
5151
"Welcome To Pastebin V3",
5252
490,
5353
0UL,

0 commit comments

Comments
 (0)