Show More
@@ -1605,7 +1605,7 b' class TestResult(unittest._TextTestResul' | |||
|
1605 | 1605 | self.stream.write('Accept this change? [n] ') |
|
1606 | 1606 | answer = sys.stdin.readline().strip() |
|
1607 | 1607 | if answer.lower() in ('y', 'yes'): |
|
1608 |
if test. |
|
|
1608 | if test.path.endswith(b'.t'): | |
|
1609 | 1609 | rename(test.errpath, test.path) |
|
1610 | 1610 | else: |
|
1611 | 1611 | rename(test.errpath, '%s.out' % test.path) |
@@ -668,6 +668,58 b' Race condition - test file was modified ' | |||
|
668 | 668 | |
|
669 | 669 | $ rm test-race.t |
|
670 | 670 | |
|
671 | When "#testcases" is used in .t files | |
|
672 | ||
|
673 | $ cat >> test-cases.t <<EOF | |
|
674 | > #testcases a b | |
|
675 | > #if a | |
|
676 | > $ echo 1 | |
|
677 | > #endif | |
|
678 | > #if b | |
|
679 | > $ echo 2 | |
|
680 | > #endif | |
|
681 | > EOF | |
|
682 | ||
|
683 | $ cat <<EOF | rt -i test-cases.t 2>&1 | |
|
684 | > y | |
|
685 | > y | |
|
686 | > EOF | |
|
687 | ||
|
688 | --- $TESTTMP/test-cases.t | |
|
689 | +++ $TESTTMP/test-cases.t.a.err | |
|
690 | @@ -1,6 +1,7 @@ | |
|
691 | #testcases a b | |
|
692 | #if a | |
|
693 | $ echo 1 | |
|
694 | + 1 | |
|
695 | #endif | |
|
696 | #if b | |
|
697 | $ echo 2 | |
|
698 | Accept this change? [n] . | |
|
699 | --- $TESTTMP/test-cases.t | |
|
700 | +++ $TESTTMP/test-cases.t.b.err | |
|
701 | @@ -5,4 +5,5 @@ | |
|
702 | #endif | |
|
703 | #if b | |
|
704 | $ echo 2 | |
|
705 | + 2 | |
|
706 | #endif | |
|
707 | Accept this change? [n] . | |
|
708 | # Ran 2 tests, 0 skipped, 0 failed. | |
|
709 | ||
|
710 | $ cat test-cases.t | |
|
711 | #testcases a b | |
|
712 | #if a | |
|
713 | $ echo 1 | |
|
714 | 1 | |
|
715 | #endif | |
|
716 | #if b | |
|
717 | $ echo 2 | |
|
718 | 2 | |
|
719 | #endif | |
|
720 | ||
|
721 | $ rm test-cases.t | |
|
722 | ||
|
671 | 723 | (reinstall) |
|
672 | 724 | $ mv backup test-failure.t |
|
673 | 725 |
General Comments 0
You need to be logged in to leave comments.
Login now