This instance was upgraded to Heptapod 0.27.2 on 2021-12-08 at 22:00 UTC+1

Commit d7d57a28 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

tests: move ad-hoc random_rev.py to testlib/random-revs.py

parent 57030b9d71c3
......@@ -21,16 +21,6 @@ Test for stable ordering capabilities
> done;
> }
$ cat << EOF >> random_rev.py
> import random
> import sys
>
> loop = int(sys.argv[1])
> var = int(sys.argv[2])
> for x in range(loop):
> print(x + random.randint(0, var))
> EOF
Check criss cross merge
=======================
......@@ -708,7 +698,7 @@ Test stability of this mess
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd crisscross_random
$ for x in `python ../random_rev.py 50 44`; do
$ for x in `python "$TESTDIR/testlib/random-revs.py" 50 44`; do
> # using python to benefit from the random seed
> hg pull -r $x --quiet
> done;
......
......@@ -23,16 +23,6 @@ Test for stable ordering capabilities
> done;
> }
$ cat << EOF >> random_rev.py
> import random
> import sys
>
> loop = int(sys.argv[1])
> var = int(sys.argv[2])
> for x in range(loop):
> print(x + random.randint(0, var))
> EOF
Basic tests
===========
(no criss cross merge)
......@@ -667,7 +657,7 @@ Multiple recursions
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd recursion_random
$ for x in `python ../random_rev.py 15 5`; do
$ for x in `python "$TESTDIR/testlib/random-revs.py" 15 5`; do
> # using python to benefit from the random seed
> hg pull -r $x --quiet
> done;
......
......@@ -21,16 +21,6 @@ Test for stable ordering capabilities
> done;
> }
$ cat << EOF >> random_rev.py
> import random
> import sys
>
> loop = int(sys.argv[1])
> var = int(sys.argv[2])
> for x in range(loop):
> print(x + random.randint(0, var))
> EOF
Check criss cross merge
=======================
......@@ -820,7 +810,7 @@ Test stability of this mess
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd crisscross_random
$ for x in `python ../random_rev.py 50 44`; do
$ for x in `python "$TESTDIR/testlib/random-revs.py" 50 44`; do
> # using python to benefit from the random seed
> hg pull -r $x --quiet
> done;
......
......@@ -24,16 +24,6 @@ Test for stable ordering capabilities
> done;
> }
$ cat << EOF >> random_rev.py
> import random
> import sys
>
> loop = int(sys.argv[1])
> var = int(sys.argv[2])
> for x in range(loop):
> print(x + random.randint(0, var))
> EOF
Basic tests
===========
(no criss cross merge)
......@@ -822,7 +812,7 @@ Multiple recursions
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd recursion_random
$ for x in `python ../random_rev.py 15 5`; do
$ for x in `python "$TESTDIR/testlib/random-revs.py" 15 5`; do
> # using python to benefit from the random seed
> hg pull -r $x --quiet
> done;
......
#!/usr/bin/env python
"""
This simple script outputs a sequence of numbers separated by newlines. The
amount of numbers and their approximate values can be controlled by two command
line arguments.
Usage: $0 COUNT MAXADD. COUNT will determine the amount of numbers printed, and
MAXADD will limit the value that will be added to each of those numbers.
"""
from __future__ import print_function
import random
import sys
def main():
count = int(sys.argv[1])
maxadd = int(sys.argv[2])
for x in range(count):
print(x + random.randint(0, maxadd))
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment