Skip to content

Commit 1361737

Browse files
authored
Merge pull request #2 from LuyaoHuang/fixbug1
Some improvement
2 parents 36530ce + eb9c82f commit 1361737

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

dice/core/constraint.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ def apply(self, item):
286286
"""
287287
def _name2path(name):
288288
if not name.startswith(self.path_prefix):
289-
raise ConstraintError(
290-
"Solution %s is not a path variable" % name)
289+
return name
291290
return name[len(self.path_prefix):].replace('_', '/')
292291

293292
t = self._choose()

dice/core/trace.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def __repr__(self):
4545
for line in self.trace:
4646
if isinstance(line, ast.Compare):
4747
s = str(line.ops[0].__class__.__name__)
48+
elif isinstance(line, ast.Call):
49+
s = line.func.id
4850
else:
4951
s = line.value.func.id
5052
lines.append(s)
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
- name: option
2-
target: option
3-
tree: |
4-
if self is Integer:
5-
if self < 0:
2+
oracle: |
3+
if option is Integer:
4+
if option < 0:
65
return FAIL('Min input is 0')
7-
elif self > 9223372036854775808:
6+
elif option > 9223372036854775808:
87
return FAIL('Number overflow')
9-
elif self > 1000:
8+
elif option > 1000:
109
return FAIL('Max input is 1000')
1110
else:
12-
return PASS()
11+
return SUCCESS()
1312
else:
1413
return FAIL('Invalid number')

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ commands =
3232
deps =
3333
-rrequirements.txt
3434
sphinx
35+
sphinx_rtd_theme

0 commit comments

Comments
 (0)