mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
Oops, isMainModule will not run of course for all_tests (#841)
This commit is contained in:
parent
1afdfdf2ff
commit
0135189e4c
@ -1,8 +1,8 @@
|
||||
# Nimbus
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Licensed under either of
|
||||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
||||
# Nimbus - Fluffy
|
||||
# Copyright (c) 2021 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
import
|
||||
@ -52,23 +52,18 @@ let wrongArrayElement =
|
||||
]
|
||||
"""
|
||||
|
||||
|
||||
proc bridgeParserMain*() =
|
||||
suite "Bridge client parser suite":
|
||||
test "Parsing valid bridge_getBlockWitness response":
|
||||
let asJson = parseJson(validResponse)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isOk()
|
||||
let sequenceResult = parseResult.get()
|
||||
check sequenceResult.len() == 19
|
||||
test "Parsing invalid bridge_getBlockWitness with wrong top type":
|
||||
let asJson = parseJson(wronRespType)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isErr()
|
||||
test "Parsing invalid bridge_getBlockWitness with wrong array element":
|
||||
let asJson = parseJson(wrongArrayElement)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isErr()
|
||||
|
||||
when isMainModule:
|
||||
bridgeParserMain()
|
||||
suite "Bridge client parser suite":
|
||||
test "Parsing valid bridge_getBlockWitness response":
|
||||
let asJson = parseJson(validResponse)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isOk()
|
||||
let sequenceResult = parseResult.get()
|
||||
check sequenceResult.len() == 19
|
||||
test "Parsing invalid bridge_getBlockWitness with wrong top type":
|
||||
let asJson = parseJson(wronRespType)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isErr()
|
||||
test "Parsing invalid bridge_getBlockWitness with wrong array element":
|
||||
let asJson = parseJson(wrongArrayElement)
|
||||
let parseResult = parseWitness(asJson)
|
||||
check parseResult.isErr()
|
||||
|
Loading…
x
Reference in New Issue
Block a user