add some test

This commit is contained in:
BLUELOVETH 2023-05-28 14:23:16 +08:00
parent e1eed59030
commit f2d87467df
2 changed files with 22 additions and 1 deletions

4
.gitignore vendored
View File

@ -23,3 +23,7 @@ profile.sh
test test
tmp.rar tmp.rar
src/httplib.h src/httplib.h
pocketpy.exe
main.obj
pocketpy.exp
pocketpy.lib

View File

@ -19,4 +19,21 @@ class A:
return self._x return self._x
a = A(1) a = A(1)
assert a.x == 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