From ed02282bba468ec7224b7e836d3fe4543bf5ba1e Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 10:29:49 +0200 Subject: additional test for OP_SIZE in script_valid.json --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test/data/script_valid.json') diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 7546a3b1f..2827126f2 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -126,6 +126,7 @@ ["-9223372036854775807", "SIZE 8 EQUAL"], ["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL"], +["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "SIZE does not consume argument"], ["2 -2 ADD", "0 EQUAL"], ["2147483647 -2147483647 ADD", "0 EQUAL"], -- cgit v1.2.3 From 833ff161bc5e44ce59b16e0ce316818f8ae69d8a Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 10:54:04 +0200 Subject: script tests: values that overflow to 0 are true --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test/data/script_valid.json') diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 2827126f2..27778fb1d 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -10,6 +10,7 @@ [" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], ["1", ""], +["0x09 0x00000000 0x00000000 0x10", "", "equals zero when cast to Int64"], ["0x01 0x0b", "11 EQUAL", "push 1 byte"], ["0x02 0x417a", "'Az' EQUAL"], -- cgit v1.2.3 From 4cac5dbf83a3069e9d25051f4c832c537a527495 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 12:55:46 +0200 Subject: script tests: value with trailing 0x00 is true --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test/data/script_valid.json') diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 27778fb1d..af0326ad9 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -10,6 +10,7 @@ [" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], ["1", ""], +["0x02 0x01 0x00", "", "all bytes are significant, not only the last one"], ["0x09 0x00000000 0x00000000 0x10", "", "equals zero when cast to Int64"], ["0x01 0x0b", "11 EQUAL", "push 1 byte"], -- cgit v1.2.3 From 89101c6e78d1640dae06a2b978b752e69aa504a0 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 15:41:45 +0200 Subject: script test: test case for 5-byte bools --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test/data/script_valid.json') diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index af0326ad9..082c65efe 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -66,6 +66,7 @@ ["0", "IF RETURN ENDIF 1", "RETURN only works if executed"], ["1 1", "VERIFY"], +["1 0x05 0x01 0x00 0x00 0x00 0x00", "VERIFY", "values >4 bytes can be cast to boolean"], ["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL"], ["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL"], -- cgit v1.2.3