2015-05-07 19:18:28 -04:00
|
|
|
# test machine module
|
|
|
|
|
2015-06-15 18:35:15 -04:00
|
|
|
try:
|
2022-08-18 02:57:45 -04:00
|
|
|
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")
|