fix: fix py test error issue

上级 00dcb5b5
......@@ -3,5 +3,8 @@ package chapi.ast.pythonast
import org.junit.jupiter.api.Test
internal class PythonAnalyserTest {
@Test
internal fun shouldIdentBuilderPattern() {
}
}
......@@ -9,13 +9,15 @@ internal class PythonFullIdentListenerTest {
internal fun shouldAnalysisPython2() {
val python2HelloWorld = """print("Hello, World!")"""
PythonAnalyser().analysis(python2HelloWorld, "")
val codeContainer = PythonAnalyser().analysis(python2HelloWorld, "py2.py")
assertEquals(codeContainer.FullName, "py2.py")
}
@Test
internal fun shouldAnalysisPython3() {
val py3HelloWorld = """print "Hello, World!""""
PythonAnalyser().analysis(py3HelloWorld, "")
val codeContainer = PythonAnalyser().analysis(py3HelloWorld, "py3.py")
assertEquals(codeContainer.FullName, "py3.py")
}
@Test
......
## https://stackoverflow.com/questions/17321167/calling-chains-methods-with-intermediate-results
class Person:
def setName(self, name):
self.name = name
return self ## this is what makes this work
def setAge(self, age):
self.age = age;
return self;
def setSSN(self, ssn):
self.ssn = ssn
return self
p = Person()
p.setName("Hunter").setAge(24).setSSN("111-22-3333")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册