tests/struct*: Make skippable.

This commit is contained in:
Paul Sokolovsky 2016-12-19 19:40:43 +03:00
parent de9cd00b39
commit 91359c8690
2 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,13 @@
try:
import ustruct as struct
except:
import struct
try:
import struct
except ImportError:
import sys
print("SKIP")
sys.exit()
print(struct.calcsize("<bI"))
print(struct.unpack("<bI", b"\x80\0\0\x01\0"))
print(struct.calcsize(">bI"))

View File

@ -3,7 +3,12 @@
try:
import ustruct as struct
except:
import struct
try:
import struct
except ImportError:
import sys
print("SKIP")
sys.exit()
print(struct.calcsize('0s'))
print(struct.unpack('0s', b''))