Open joshuahannan opened 2 weeks ago
@joshuahannan Can you please share (a link to) the test code you are running?
Test
already has a fun assertError(_ result: {Result}, errorMessage: String)
, maybe we should add something like:
fun assertNoError(_ result: {Result}) {
if let error = result.error {
assert(false, message: "error: ".concat(error.message))
}
}
cc @m-Peter
Test
already has afun assertError(_ result: {Result}, errorMessage: String)
, maybe we should add something like:fun assertNoError(_ result: {Result}) { if let error = result.error { assert(false, message: "error: ".concat(error.message)) } }
@turbolent That's a neat idea :raised_hands:
But the issue being raised here by Joshua, is something related to the printing of a Cadence interpreter error:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\n\nerror: resource `FiatToken.Admin` does not conform to resource interface `OnChainMultiSig.PublicSigner`
\n --> 0000000000000007.FiatToken:334:22
\n |
\n334 | \taccess(all)\tresource Admin: OnChainMultiSig.PublicSigner, ResourceId, AdminCapReceiver {
\n | \t \t ^\n ... \n |\n391 | \t\taccess(all) fun UUID(): UInt64{
\n | \t\t ---- mismatch here
\n ... \n |\n395 | \t\taccess(all) fun getTxIndex(): UInt64{
\n | \t\t ---------- mismatch here
\n\n\n")
I will check to see why it happens. Most likely something in the flow test
command, or something related.
Issue to be solved
When running tests with the Cadence testing framework, the errors are spat out as a huge wall of text. It would be great if they were printed in a way that makes them easier to read.
Example:
Suggested Solution
Format the output so that the errors are easy to read and understand