mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
add some test
This commit is contained in:
parent
e1eed59030
commit
f2d87467df
4
.gitignore
vendored
4
.gitignore
vendored
@ -23,3 +23,7 @@ profile.sh
|
||||
test
|
||||
tmp.rar
|
||||
src/httplib.h
|
||||
pocketpy.exe
|
||||
main.obj
|
||||
pocketpy.exp
|
||||
pocketpy.lib
|
||||
|
@ -20,3 +20,20 @@ class A:
|
||||
|
||||
a = A(1)
|
||||
assert a.x == 1
|
||||
|
||||
class B:
|
||||
def __init__(self):
|
||||
self._x = 1
|
||||
|
||||
def _x_setter(self, v):
|
||||
self._x = v
|
||||
|
||||
B.x = property(
|
||||
lambda self: self._x,
|
||||
B._x_setter
|
||||
)
|
||||
|
||||
b = B()
|
||||
assert b.x == 1
|
||||
b.x = 2
|
||||
assert b.x == 2
|
Loading…
x
Reference in New Issue
Block a user