Subject: [bug#69620] [rust-team v3 2/9] gnu: Enables rust-pear-codegen-0.2 tests

From: Aaron Covrig <[email-masked]>
Date: Sun, 24 Mar 2024 11:19:54 -0400

* gnu/packages/crates-io.scm (rust-pear-codegen-0.2): Enables building
  test cases by adding stripped out development input (rust-pear-0.2)
---
 gnu/packages/crates-io.scm | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index ea8dcb5cec..492c077eae 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -49315,19 +49315,25 @@ (define-public rust-pear-codegen-0.2
        (uri (crate-uri "pear_codegen" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "0xrwnlncg7l64gfy82vf6kq55ww7p6krq6bc3pqwymxpiq76f8if"))))
+        (base32 "0xrwnlncg7l64gfy82vf6kq55ww7p6krq6bc3pqwymxpiq76f8if"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Add missing development dependency (for tests)
+                   (substitute* "Cargo.toml"
+                     (("\\[dev-dependencies\\]" all)
+                      (string-append "[dev-dependencies.pear]" "\n"
+                                     "version = \"0.2.8\""))) #t))))
     (build-system cargo-build-system)
     (arguments
-     `(#:tests? #f  ; use of undeclared crate or module `pear`
-       #:cargo-inputs
-       (("rust-proc-macro2" ,rust-proc-macro2-1)
-        ("rust-proc-macro2-diagnostics" ,rust-proc-macro2-diagnostics-0.10)
-        ("rust-quote" ,rust-quote-1)
-        ("rust-syn" ,rust-syn-2))))
+     `(#:cargo-inputs (("rust-proc-macro2" ,rust-proc-macro2-1)
+                       ("rust-proc-macro2-diagnostics" ,rust-proc-macro2-diagnostics-0.10)
+                       ("rust-quote" ,rust-quote-1)
+                       ("rust-syn" ,rust-syn-2))
+       ;; Add missing dev crate
+       #:cargo-development-inputs (("rust-pear" ,rust-pear-0.2))))
     (home-page "https://crates.io/crates/pear_codegen")
     (synopsis "Codegen for pear")
-    (description
-     "This package provides a (codegen) pear is a fruit.")
+    (description "This package provides a (codegen) pear is a fruit.")
     (license (list license:expat license:asl2.0))))
 
 (define-public rust-pear-codegen-0.1
-- 
2.41.0