Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vrthra committed Dec 11, 2017
1 parent 9ec3859 commit 0639b8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ test:
@mkdir -p .cov
env PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=.:src:examples python3 ./src/xmutant.py -a $(tries) $(module)

file=examples/heapsort.py
file=examples/binarysearch.py
file=examples/fact.py
doctest:
env PYTHONPATH=.:src:examples python3 -m doctest -v $(file)
Expand Down
4 changes: 4 additions & 0 deletions examples/binarysearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

@typ.typ(items=[int], x=int)
def binary_search(items, x):
"""
>>> binary_search([3,2,4,6,1,9], 6)
4
"""
lo = 0
hi = len(items)
items.sort()
Expand Down
2 changes: 1 addition & 1 deletion examples/heapsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def heap_sort(items):
[1, 2, 2]
"""
# in pseudo-code, heapify only called once, so inline it here
for start in range((len(items)-2)/2, -1, -1):
for start in range((len(items)-2)//2, -1, -1):
siftdown(items, start, len(items)-1)

for end in range(len(items)-1, 0, -1):
Expand Down
2 changes: 1 addition & 1 deletion src/mutants.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def allm():
"jms, %s : swap %s")
binaryMutationRelational = SwapOpsTemplate({'BINARY_AND': '&&', 'BINARY_OR': '||'}, "bmr, %s : swap %s")
binaryMutationNum = SwapOpsTemplate(
{'BINARY_FLOOR_DIVIDE': '//', 'BINARY_TRUE_DIVIDE': './.', 'BINARY_DIVIDE': '/', 'BINARY_MULTIPLY': '*',
{'BINARY_FLOOR_DIVIDE': '//', 'BINARY_TRUE_DIVIDE': './.', 'BINARY_TRUE_DIVIDE': '/', 'BINARY_MULTIPLY': '*',
'BINARY_POWER': '**', 'BINARY_MODULO': '%', 'BINARY_ADD': '+', 'BINARY_SUBTRACT': '-', 'BINARY_LSHIFT': '<<',
'BINARY_RSHIFT': '>>', 'BINARY_XOR': '^'}, "bmn, %s : swap %s")

Expand Down

0 comments on commit 0639b8a

Please sign in to comment.