summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
Diffstat (limited to 'test cases')
-rw-r--r--test cases/failing/136 cargo toml error/meson.build19
-rw-r--r--test cases/failing/136 cargo toml error/subprojects/foo-0-rs.wrap5
-rw-r--r--test cases/failing/136 cargo toml error/subprojects/foo-0-rs/Cargo.toml6
-rw-r--r--test cases/failing/136 cargo toml error/test.json8
4 files changed, 38 insertions, 0 deletions
diff --git a/test cases/failing/136 cargo toml error/meson.build b/test cases/failing/136 cargo toml error/meson.build
new file mode 100644
index 000000000..6efaab2c5
--- /dev/null
+++ b/test cases/failing/136 cargo toml error/meson.build
@@ -0,0 +1,19 @@
+project('cargo-toml-error', 'c')
+
+if not add_languages('rust', required: false)
+ error('MESON_SKIP_TEST Rust not present, required for Cargo subprojets')
+endif
+
+# Check if we have tomllib/tomli (not toml2json)
+python = find_program('python3', 'python')
+result = run_command(python, '-c', 'import tomllib', check: false)
+if result.returncode() != 0
+ result = run_command(python, '-c', 'import tomli', check: false)
+ if result.returncode() != 0
+ # Skip test if using toml2json - error format will be different
+ error('MESON_SKIP_TEST toml2json in use, skipping test')
+ endif
+endif
+
+# This should trigger a CargoTomlError with proper location info
+foo_dep = dependency('foo-0')
diff --git a/test cases/failing/136 cargo toml error/subprojects/foo-0-rs.wrap b/test cases/failing/136 cargo toml error/subprojects/foo-0-rs.wrap
new file mode 100644
index 000000000..c39970188
--- /dev/null
+++ b/test cases/failing/136 cargo toml error/subprojects/foo-0-rs.wrap
@@ -0,0 +1,5 @@
+[wrap-file]
+method = cargo
+
+[provide]
+dependency_names = foo-0
diff --git a/test cases/failing/136 cargo toml error/subprojects/foo-0-rs/Cargo.toml b/test cases/failing/136 cargo toml error/subprojects/foo-0-rs/Cargo.toml
new file mode 100644
index 000000000..2f2d7a681
--- /dev/null
+++ b/test cases/failing/136 cargo toml error/subprojects/foo-0-rs/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "foo"
+version = "0.0.1"
+edition = "2021"
+# This creates a TOML decode error: duplicate key
+name = "bar" \ No newline at end of file
diff --git a/test cases/failing/136 cargo toml error/test.json b/test cases/failing/136 cargo toml error/test.json
new file mode 100644
index 000000000..480cf64d5
--- /dev/null
+++ b/test cases/failing/136 cargo toml error/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "match": "re",
+ "line": "test cases/failing/136 cargo toml error/(subprojects/foo-0-rs/Cargo\\.toml:6:13|meson\\.build:19:10): ERROR: Cannot overwrite a value( \\(at.*)?"
+ }
+ ]
+}