2015-05-07 19:18:28 -04:00
|
|
|
# test machine module
|
|
|
|
|
2015-06-15 18:35:15 -04:00
|
|
|
try:
|
2016-07-30 21:30:48 -04:00
|
|
|
try:
|
|
|
|
import umachine as machine
|
|
|
|
except ImportError:
|
|
|
|
import machine
|
2017-02-14 17:56:22 -05:00
|
|
|
machine.mem8
|
|
|
|
except:
|
2015-06-15 18:35:15 -04:00
|
|
|
print("SKIP")
|
2017-06-10 13:14:16 -04:00
|
|
|
raise SystemExit
|
2015-06-15 18:35:15 -04:00
|
|
|
|
2015-05-07 19:18:28 -04:00
|
|
|
print(machine.mem8)
|
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem16[1]
|
|
|
|
except ValueError:
|
|
|
|
print("ValueError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem16[1] = 1
|
|
|
|
except ValueError:
|
|
|
|
print("ValueError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
del machine.mem8[0]
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
2020-10-30 22:34:58 -04:00
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem8[0:1]
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem8[0:1] = 10
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem8["hello"]
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
machine.mem8["hello"] = 10
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|