コード例 #1
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoFunctionIfNoPrivatePublicKeyword(self):
     concepts = parseConcepts("void helloWorld() ")
     self.assertNotIn(Concept.FUNCTION, concepts)
コード例 #2
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseReturn(self):
     concepts = parseConcepts("return String();")
     self.assertIn(Concept.RETURN, concepts)
コード例 #3
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseNewStatement(self):
     concepts = parseConcepts("String b = new String();")
     self.assertIn(Concept.OBJECT, concepts)
コード例 #4
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseAssignmentFromEquals(self):
     concepts = parseConcepts("a = 2;")
     self.assertIn(Concept.ASSIGNMENT, concepts)
コード例 #5
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseIfStatement(self):
     concepts = parseConcepts("	if (i == 5) {")
     self.assertIn(Concept.CONDITIONAL, concepts)
コード例 #6
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseLessThan(self):
     concepts = parseConcepts("a = b < c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #7
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseForWithNoSpaceBeforeParens(self):
     concepts = parseConcepts("for(int i = 0; i < 2; i++) {")
     self.assertIn(Concept.LOOP, concepts)
コード例 #8
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testFunctionDeclarationOpeningParenNoSemicolon(self):
     concepts = parseConcepts("public void helloWorld() ")
     self.assertIn(Concept.FUNCTION, concepts)
コード例 #9
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoFunctionIfNoPrivatePublicKeyword(self):
     concepts = parseConcepts("void helloWorld() ")
     self.assertNotIn(Concept.FUNCTION, concepts)
コード例 #10
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseLeftBracket(self):
     concepts = parseConcepts("int a = b[2];")
     self.assertIn(Concept.ARRAY, concepts)
コード例 #11
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseNewStatement(self):
     concepts = parseConcepts("String b = new String();")
     self.assertIn(Concept.OBJECT, concepts)
コード例 #12
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseReturn(self):
     concepts = parseConcepts("return String();")
     self.assertIn(Concept.RETURN, concepts)
コード例 #13
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseIfFromVarName(self):
     concepts = parseConcepts("int iffy = 5;")
     self.assertNotIn(Concept.CONDITIONAL, concepts)
コード例 #14
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseIfStatement(self):
     concepts = parseConcepts("	if (i == 5) {")
     self.assertIn(Concept.CONDITIONAL, concepts)
コード例 #15
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseMinus(self):
     concepts = parseConcepts("a = b - c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #16
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoFunctionIfEndsWithSemicolon(self):
     concepts = parseConcepts("helloWorld(1, 2);")
     self.assertNotIn(Concept.FUNCTION, concepts)
コード例 #17
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseSlash(self):
     concepts = parseConcepts("a = b / c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #18
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseMinus(self):
     concepts = parseConcepts("a = b - c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #19
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseRelOpAndArithOp(self):
     concepts = parseConcepts("a = (b > c + 5);")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #20
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseTimes(self):
     concepts = parseConcepts("a = b * c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #21
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseDoubleEqualsRelational(self):
     concepts = parseConcepts("if (a == 3) {")
     self.assertNotIn(Concept.ASSIGNMENT, concepts)
コード例 #22
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseSlash(self):
     concepts = parseConcepts("a = b / c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #23
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseDoubleEqualsRelational(self):
     concepts = parseConcepts("if (a == 3) {")
     self.assertNotIn(Concept.ASSIGNMENT, concepts)
コード例 #24
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseGreaterThan(self):
     concepts = parseConcepts("a = b > c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #25
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseIfFromVarName(self):
     concepts = parseConcepts("int iffy = 5;");
     self.assertNotIn(Concept.CONDITIONAL, concepts)
コード例 #26
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseLessThan(self):
     concepts = parseConcepts("a = b < c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #27
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseLeftBracket(self):
     concepts = parseConcepts("int a = b[2];")
     self.assertIn(Concept.ARRAY, concepts)
コード例 #28
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseNotEquals(self):
     concepts = parseConcepts("a = b != c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #29
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testFunctionDeclarationOpeningParenNoSemicolon(self):
     concepts = parseConcepts("public void helloWorld() ")
     self.assertIn(Concept.FUNCTION, concepts)
コード例 #30
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseRelOpAndArithOp(self):
     concepts = parseConcepts("a = (b > c + 5);")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #31
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoFunctionIfEndsWithSemicolon(self):
     concepts = parseConcepts("helloWorld(1, 2);")
     self.assertNotIn(Concept.FUNCTION, concepts)
コード例 #32
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseForLoopAtStartOfLine(self):
     concepts = parseConcepts("for (int i = 0; i < 2; i++) {")
     self.assertIn(Concept.LOOP, concepts)
コード例 #33
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseTimes(self):
     concepts = parseConcepts("a = b * c;")
     self.assertIn(Concept.ARITHMETIC_OP, concepts)
コード例 #34
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseForWithNoSpaceBeforeParens(self):
     concepts = parseConcepts("for(int i = 0; i < 2; i++) {")
     self.assertIn(Concept.LOOP, concepts)
コード例 #35
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseGreaterThan(self):
     concepts = parseConcepts("a = b > c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #36
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseWhileLoop(self):
     concepts = parseConcepts("while(i > 0)")
     self.assertIn(Concept.LOOP, concepts)
コード例 #37
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseNotEquals(self):
     concepts = parseConcepts("a = b != c;")
     self.assertIn(Concept.RELATIONAL_OP, concepts)
コード例 #38
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseForLoopFromVarname(self):
     concepts = parseConcepts("format = 2;")
     self.assertNotIn(Concept.LOOP, concepts)
コード例 #39
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseForLoopAtStartOfLine(self):
     concepts = parseConcepts("for (int i = 0; i < 2; i++) {")
     self.assertIn(Concept.LOOP, concepts)
コード例 #40
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testNoParseForLoopFromVarname(self):
     concepts = parseConcepts("format = 2;")
     self.assertNotIn(Concept.LOOP, concepts)
コード例 #41
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseWhileLoop(self):
     concepts = parseConcepts("while(i > 0)")
     self.assertIn(Concept.LOOP, concepts)
コード例 #42
0
ファイル: test_parse.py プロジェクト: pombreda/StackSkim
 def testParseAssignmentFromEquals(self):
     concepts = parseConcepts("a = 2;")
     self.assertIn(Concept.ASSIGNMENT, concepts)