Skip to content

Commit

Permalink
Add test for GitHub issue 18
Browse files Browse the repository at this point in the history
* run-test.py
  (internal_co_broken_rcsfile): New test.
  (test_list): Add it.
  • Loading branch information
futatuki committed Dec 19, 2021
1 parent 3e9e057 commit f32ce3e
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 5 deletions.
45 changes: 40 additions & 5 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3345,6 +3345,40 @@ def internal_co_keywords():
raise Failure()


@Cvs2SvnTestFunction
def internal_co_broken_rcsfile():
"check if internal co can handle broken delta"

# This is a test for GitHub issue 18.

# Check if internal co can handle broken delta which inserts unterminated
# line other than after last line. Although it does not seem such a
# "broken" RCS file could be generated by normal RCS/CVS operation,
# RCS/CVS can handle it.

### TODO: Once an unterminated line is inserted in a middle of lines
### in line buffer, there can be more critical situations than one
### that the irregular.txt,v has. So we need to add such test data.

rcs_conv = ensure_conversion(
'gh-issue-18-irregular-rcsfile',
args=['--use-rcs', '--default-eol=native'],
dumpfile='broken-rcsfile-rcs.dump',
)
conv = ensure_conversion(
'gh-issue-18-irregular-rcsfile',
args=['--default-eol=native'],
dumpfile='broken-rcsfile-int.dump',
)
if conv.output_found(r'WARNING\: internal problem\: leftover revisions'):
raise Failure()
rcs_lines = list(open(rcs_conv.dumpfile, 'rb'))
lines = list(open(conv.dumpfile, 'rb'))
# Compare all lines following the repository UUID:
if lines[3:] != rcs_lines[3:]:
raise Failure()


@Cvs2SvnTestFunction
def timestamp_chaos():
"test timestamp adjustments"
Expand Down Expand Up @@ -4237,10 +4271,11 @@ def vendor_1_1_not_root():
internal_co_exclude,
internal_co_trunk_only,
internal_co_keywords,
internal_co_broken_rcsfile,
leftover_revs,
requires_internal_co,
timestamp_chaos,
# 140:
timestamp_chaos,
symlinks,
empty_trunk_path,
preferred_parent_cycle,
Expand All @@ -4250,8 +4285,8 @@ def vendor_1_1_not_root():
add_on_branch,
main_git,
main_git2,
main_git_merged,
# 150:
main_git_merged,
main_git2_merged,
git_options,
main_hg,
Expand All @@ -4261,8 +4296,8 @@ def vendor_1_1_not_root():
EOLVariants('LF'),
EOLVariants('CR'),
EOLVariants('CRLF'),
EOLVariants('native'),
# 160:
EOLVariants('native'),
no_revs_file,
mirror_keyerror_test,
exclude_ntdb_test,
Expand All @@ -4272,8 +4307,8 @@ def vendor_1_1_not_root():
missing_deltatext,
transform_unlabeled_branch_name,
ignore_unlabeled_branch,
exclude_unlabeled_branch,
# 170:
exclude_unlabeled_branch,
unlabeled_branch_name_collision,
collision_with_unlabeled_branch_name,
many_deletes,
Expand All @@ -4283,8 +4318,8 @@ def vendor_1_1_not_root():
exclude_symbol_default,
add_on_branch2,
branch_from_vendor_branch,
strange_default_branch,
# 180:
strange_default_branch,
move_parent,
log_message_eols,
missing_vendor_branch,
Expand Down
88 changes: 88 additions & 0 deletions test-data/gh-issue-18-irregular-rcsfile-cvsrepos/irregular.txt,v
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
head 1.5;
access;
symbols;
locks; strict;
comment @# @;


1.5
date 2021.11.26.04.16.45; author futatuki; state Exp;
branches;
next 1.4;

1.4
date 2021.11.26.04.14.23; author futatuki; state Exp;
branches;
next 1.3;

1.3
date 2021.11.26.03.46.06; author futatuki; state Exp;
branches;
next 1.2;

1.2
date 2021.11.26.03.41.39; author futatuki; state Exp;
branches;
next 1.1;

1.1
date 2021.11.26.03.34.28; author futatuki; state Exp;
branches;
next ;


desc
@create a new file irregular.txt
@


1.5
log
@r1.5:
@
text
@aaa
bbb
ccc
hhh@


1.4
log
@r1.4:
@
text
@d4 1
a4 1
ggg@


1.3
log
@r1.3: s/eee/fff/
@
text
@d3 1
a3 1
fff@


1.2
log
@r1.2: s/ddd/eee/
@
text
@d3 1
a3 1
eee@


1.1
log
@r1.1
@
text
@d3 1
a3 1
ddd@

0 comments on commit f32ce3e

Please sign in to comment.