aboutsummaryrefslogtreecommitdiff
path: root/semver/tests/regression.rs
diff options
context:
space:
mode:
Diffstat (limited to 'semver/tests/regression.rs')
-rw-r--r--semver/tests/regression.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/semver/tests/regression.rs b/semver/tests/regression.rs
new file mode 100644
index 0000000..ef568a7
--- /dev/null
+++ b/semver/tests/regression.rs
@@ -0,0 +1,25 @@
+extern crate semver;
+extern crate crates_index;
+extern crate tempdir;
+
+// This test checks to see if every existing crate parses successfully. Important to not break the
+// Rust universe!
+
+#[cfg(feature = "ci")]
+#[test]
+fn test_regressions() {
+ use tempdir::TempDir;
+ use crates_index::Index;
+ use semver::Version;
+
+ let dir = TempDir::new("semver").unwrap();
+ let index = Index::new(dir.into_path());
+ index.clone().unwrap();
+
+ for krate in index.crates() {
+ for version in krate.versions() {
+ let v = version.version();
+ assert!(Version::parse(v).is_ok(), "failed: {} ({})", version.name(), v);
+ }
+ }
+}