Skip to content

Commit 89378e1

Browse files
committed
Add failing test (#19)
1 parent 01ca770 commit 89378e1

File tree

7 files changed

+41
-4
lines changed

7 files changed

+41
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:dc8ecb6536cebef322bd7a4eea5e177778b83cadae38dc04b8c185723dbad13b
3-
size 581808
2+
oid sha256:a4c725b07eae662b3f2fcd7a2ae6440fbaaaca0f1a73c9d44fa92f48d34c4a13
3+
size 582732

tests/fixtures/index-parts/commit.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,4 @@ b52f5e8ed9f2984f777720ef12ca3463eeadd93a
326326
f23a8e44f4eb505ae1d228d14053f3ab65ce3382
327327
58b54c565fe4fa88d716941e5077f0767c665b5f
328328
20eeece15a0dd4f7fa505409a5914debfb84006e
329+
reproduce-#19
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
diff --git a/al/lo/allowed b/al/lo/allowed
2+
new file mode 100644
3+
index 0000000..b30662b
4+
--- /dev/null
5+
+++ b/al/lo/allowed
6+
@@ -0,0 +1 @@
7+
+{"name":"allowed","vers":"1.0.0","deps":[],"features":{},"cksum":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","yanked":true}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reproduce issue #19

tests/fixtures/make-index-parts.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,18 @@ mkdir -p "$out"
2323
git diff "$commit"~1.."$commit" -- $path > "$out/$commit".diff
2424
git log --format=%B -n1 "$commit" > "$out/$commit.msg"
2525
done < "$commit_list"
26+
27+
base="$out/reproduce-#19"
28+
cat <<EOF > "$base.diff"
29+
diff --git a/al/lo/allowed b/al/lo/allowed
30+
new file mode 100644
31+
index 0000000..b30662b
32+
--- /dev/null
33+
+++ b/al/lo/allowed
34+
@@ -0,0 +1 @@
35+
+{"name":"allowed","vers":"1.0.0","deps":[],"features":{},"cksum":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","yanked":true}
36+
EOF
37+
echo 'reproduce-#19' >> "$commit_list"
38+
echo 'reproduce issue #19' >> "$base.msg"
39+
2640
)

tests/index/changes_between_commits.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn addition() -> crate::Result {
2121

2222
#[test]
2323
fn deletion() -> crate::Result {
24-
let changes = changes(index_ro()?, "@~326")?;
24+
let changes = changes(index_ro()?, "@~327")?;
2525
assert_eq!(changes.len(), 1);
2626
assert_eq!(changes.first().and_then(|c| c.deleted()), Some("girl"));
2727
Ok(())
@@ -53,6 +53,20 @@ fn yanked() -> crate::Result {
5353
Ok(())
5454
}
5555

56+
#[test]
57+
#[ignore]
58+
fn yanked_in_new_file() -> crate::Result {
59+
let changes = changes(index_ro()?, ":/reproduce issue #19")?;
60+
assert_eq!(changes.len(), 1);
61+
assert_eq!(
62+
changes
63+
.first()
64+
.and_then(|c| c.yanked().map(|v| v.name.as_str())),
65+
Some("allowed")
66+
);
67+
Ok(())
68+
}
69+
5670
#[test]
5771
fn unyanked_crates_recognized_as_added() -> crate::Result {
5872
let changes = changes(index_ro()?, ":/Unyanking crate `git2mail#0.3.2`")?;

tests/index/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::PathBuf;
44

55
mod changes_between_commits;
66

7-
const NUM_CHANGES_SINCE_EVER: usize = 3516;
7+
const NUM_CHANGES_SINCE_EVER: usize = 3517;
88

99
#[test]
1010
fn peek_changes() -> crate::Result {

0 commit comments

Comments
 (0)