Skip to content

Commit fb01aac

Browse files
committed
e2e(629): 补上范围的反向腿 —— 不可满足必须被拒,且拒绝里引用那条范围
1 parent 003a0c8 commit fb01aac

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

tests/e2e/629_a_version_range_is_answered_by_xpkg_dir.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,32 @@ grep -qE '/(0\.9\.9|0\.10\.[0-9]+)$' "$answered" || {
109109
exit 1
110110
}
111111

112-
echo "PASS: a range is installed and answered, and the project declared no tool"
112+
# ── the other direction ─────────────────────────────────────────────────────
113+
#
114+
# AN IMPLEMENTATION THAT PASSED THE RANGE THROUGH AS A LITERAL WOULD ALSO PASS
115+
# EVERYTHING ABOVE. What separates "the range was solved" from "the string
116+
# happened to name something" is a range that nothing can satisfy: it has to be
117+
# refused, and refused for that reason.
118+
cd "$TMP"
119+
sed 's/>=0.9.9/>=99.0.0/' dep/mcpp.toml > dep/mcpp.toml.new
120+
mv dep/mcpp.toml.new dep/mcpp.toml
121+
rm -rf app/target dep/answered.txt
122+
cd app
123+
if "$MCPP" build >unsat.log 2>&1; then
124+
echo "FAIL: an unsatisfiable range was accepted"
125+
grep -i "$TOOL" unsat.log | head -3
126+
exit 1
127+
fi
128+
grep -q 'not found in the synced index' unsat.log || {
129+
echo "FAIL: refused, but not because the range is unsatisfiable"
130+
grep -i error unsat.log | head -3
131+
exit 1
132+
}
133+
grep -q ">=99.0.0" unsat.log || {
134+
echo "FAIL: the refusal does not quote the range that could not be satisfied"
135+
grep -i error unsat.log | head -3
136+
exit 1
137+
}
138+
echo "an unsatisfiable range is refused, naming it"
139+
140+
echo "PASS: a range is installed and answered in one direction, and refused in the other"

0 commit comments

Comments
 (0)