Skip to content

Commit

Permalink
add test of DecodeBase58 skipping whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
roques authored and luke-jr committed Feb 21, 2014
1 parent 44d7f4c commit a3138ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/base58_tests.cpp
Expand Up @@ -55,6 +55,12 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
}

BOOST_CHECK(!DecodeBase58("invalid", result));

// check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end.
BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result));
BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result));
std::vector<unsigned char> expected = ParseHex("971a55");
BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());
}

// Visitor to check address type
Expand Down

0 comments on commit a3138ed

Please sign in to comment.