aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-05-24 13:29:08 -0400
committerGavin Andresen <gavinandresen@gmail.com>2012-05-24 13:29:08 -0400
commitf04017f702e36563b9ba05b3fede216767de580a (patch)
tree4bb9e411a29dd95c602c5299d4e93060bac00700 /src/test/script_tests.cpp
parentb92095f18c12bef3cc6fd621bdbda26efb126a6f (diff)
More CScript unit tests.
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r--src/test/script_tests.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index 745df4bd7b..a5fdaaa4c2 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -59,13 +59,15 @@ ParseScript(string s)
}
else if (starts_with(w, "0x") && IsHex(string(w.begin()+2, w.end())))
{
- // Hex data:
- result << ParseHex(string(w.begin()+2, w.end()));
+ // Raw hex data, inserted NOT pushed onto stack:
+ std::vector<unsigned char> raw = ParseHex(string(w.begin()+2, w.end()));
+ result.insert(result.end(), raw.begin(), raw.end());
}
- else if (s.size() >= 2 && starts_with(w, "'") && ends_with(w, "'"))
+ else if (w.size() >= 2 && starts_with(w, "'") && ends_with(w, "'"))
{
- // Single-quoted string, pushed as data:
- std::vector<unsigned char> value(s.begin()+1, s.end()-1);
+ // Single-quoted string, pushed as data. NOTE: this is poor-man's
+ // parsing, spaces/tabs/newlines in single-quoted strings won't work.
+ std::vector<unsigned char> value(w.begin()+1, w.end()-1);
result << value;
}
else if (mapOpNames.count(w))