close #5757
This commit is contained in:
parent
9107e551f1
commit
622100adb6
2 changed files with 23 additions and 3 deletions
|
|
@ -1,7 +1,10 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''{"age": 12, "bio": "\u042F Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"}
|
output: '''{"age": 12, "bio": "\u042F Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"}
|
||||||
true
|
true
|
||||||
true'''
|
true
|
||||||
|
alpha 100
|
||||||
|
omega 200
|
||||||
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import marshal
|
import marshal
|
||||||
|
|
@ -83,3 +86,22 @@ var instance1 = Person(name: "Cletus", age: 12,
|
||||||
echo($$instance1)
|
echo($$instance1)
|
||||||
echo(to[Person]($$instance1).bio == instance1.bio)
|
echo(to[Person]($$instance1).bio == instance1.bio)
|
||||||
echo(to[Person]($$instance1).blob == instance1.blob)
|
echo(to[Person]($$instance1).blob == instance1.blob)
|
||||||
|
|
||||||
|
# bug 5757
|
||||||
|
|
||||||
|
type
|
||||||
|
Something = object
|
||||||
|
x: string
|
||||||
|
y: int
|
||||||
|
|
||||||
|
var data1 = """{"x": "alpha", "y": 100}"""
|
||||||
|
var data2 = """{"x": "omega", "y": 200}"""
|
||||||
|
|
||||||
|
var r = to[Something](data1)
|
||||||
|
|
||||||
|
echo r.x, " ", r.y
|
||||||
|
|
||||||
|
r = to[Something](data2)
|
||||||
|
|
||||||
|
echo r.x, " ", r.y
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ proc newBountySource(team, token: string): BountySource =
|
||||||
result.client.headers["Referer"] = "https://salt.bountysource.com/teams/nim/admin/supporters"
|
result.client.headers["Referer"] = "https://salt.bountysource.com/teams/nim/admin/supporters"
|
||||||
result.client.headers["Origin"] = "https://salt.bountysource.com/"
|
result.client.headers["Origin"] = "https://salt.bountysource.com/"
|
||||||
|
|
||||||
import typetraits
|
|
||||||
|
|
||||||
proc getSupporters(self: BountySource): Future[JsonNode] {.async.} =
|
proc getSupporters(self: BountySource): Future[JsonNode] {.async.} =
|
||||||
let response = await self.client.get(apiUrl &
|
let response = await self.client.get(apiUrl &
|
||||||
"/supporters?order=monthly&per_page=200&team_slug=" & self.team)
|
"/supporters?order=monthly&per_page=200&team_slug=" & self.team)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue