Skip to content

Commit

Permalink
Merge d51f577 into 252595f
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Nov 5, 2018
2 parents 252595f + d51f577 commit ae9091a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/chain/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ BOOST_AUTO_TEST_CASE(script__verify__testnet_block_23428_multisig_tx__valid)
prevout.set_script(script::factory(decoded_script, false));
BOOST_REQUIRE(prevout.script().is_valid());

std::cout << prevout.script().to_string(forks) << std::endl;
std::cout << input.script().to_string(forks) << std::endl;
////std::cout << prevout.script().to_string(forks) << std::endl;
////std::cout << input.script().to_string(forks) << std::endl;
////std::cout << input.witness().to_string() << std::endl;

const auto result = script::verify(tx, index, forks);
Expand Down
25 changes: 25 additions & 0 deletions test/unicode/unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ BOOST_AUTO_TEST_CASE(unicode__to_normal_nfkd_form__validate__test)
BOOST_REQUIRE_EQUAL(normalized.c_str(), ascii_space_sandwich);
}

BOOST_AUTO_TEST_CASE(unicode__to_normal_nfkd_form__61cc81__c3a1)
{
const std::string literal_c3a1 = "á";

// This is pasted from the the BIP39 encoding:
//// github.com/bitcoin/bips/blob/master/bip-0039/spanish.txt#L93
const std::string literal_61cc81 = "";

const std::string string_c3a1 = "\xc3\xa1";
const std::string string_61cc81 = "\x61\xcc\x81";
BOOST_REQUIRE_EQUAL(string_c3a1, literal_c3a1);
BOOST_REQUIRE_EQUAL(string_61cc81, literal_61cc81);

const auto normalized_c3a1 = to_normal_nfkd_form(string_c3a1);
const auto normalized_61cc81 = to_normal_nfkd_form(string_61cc81);

#ifdef _MSC_VER
BOOST_REQUIRE_EQUAL(normalized_61cc81.c_str(), string_c3a1);
BOOST_REQUIRE_EQUAL(normalized_c3a1.c_str(), string_c3a1);
#else
BOOST_REQUIRE_EQUAL(normalized_61cc81.c_str(), string_61cc81);
BOOST_REQUIRE_EQUAL(normalized_c3a1.c_str(), string_61cc81);
#endif
}

#endif

// Use of L is not recommended as it will only work for ascii.
Expand Down

0 comments on commit ae9091a

Please sign in to comment.