Skip to content

DRAFT: chore(example-nesting): share the nesting example tests#99

Closed
dnsl48 wants to merge 2 commits into
yanganto:mainfrom
dnsl48:feat/97-nesting/poc-test
Closed

DRAFT: chore(example-nesting): share the nesting example tests#99
dnsl48 wants to merge 2 commits into
yanganto:mainfrom
dnsl48:feat/97-nesting/poc-test

Conversation

@dnsl48
Copy link
Copy Markdown

@dnsl48 dnsl48 commented May 20, 2025

Example of the problem I'm having with the "nesting" feature (#97).

Here's the error message:

cargo test
   Compiling example-nesting v0.0.0 (/mnt/workbench/toys/struct-patch/example-nesting)
error[E0063]: missing field `child_item` in initializer of `TopItemPatch`
 --> src/lib.rs:3:24
  |
3 | #[derive(Clone, Debug, Patch)]
  |                        ^^^^^ missing `child_item`
  |
  = note: this error originates in the derive macro `Patch` (in Nightly builds, run with -Z macro-backtrace for more info)

@dnsl48 dnsl48 mentioned this pull request May 20, 2025
@yanganto
Copy link
Copy Markdown
Owner

Sorry about this, there is some conflict in nesting feature and default features.

This are fixed in 0.10.2

└─[$] <feat/97-nesting/poc-test> cargo test
    Updating crates.io index
     Locking 12 packages to latest compatible versions
   Compiling proc-macro2 v1.0.95
   Compiling unicode-ident v1.0.18
   Compiling serde v1.0.219
   Compiling serde_json v1.0.140
   Compiling ryu v1.0.20
   Compiling itoa v1.0.15
   Compiling memchr v2.7.4
   Compiling quote v1.0.40
   Compiling syn v2.0.101
   Compiling serde_derive v1.0.219
   Compiling struct-patch-derive v0.10.2 (/home/yanganto/data/struct-patch/struct-patch-derive)
   Compiling struct-patch v0.10.2 (/home/yanganto/data/struct-patch/struct-patch)
   Compiling example-nesting v0.0.0 (/home/yanganto/data/struct-patch/example-nesting)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 5.16s
     Running unittests src/lib.rs (target/debug/deps/example_nesting-6cf9805edc8d2c74)

running 1 test
test tests::it_works ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests example_nesting

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Many thanks. 🙏

@dnsl48 dnsl48 force-pushed the feat/97-nesting/poc-test branch from d517307 to 92ab1de Compare May 20, 2025 18:38
@dnsl48
Copy link
Copy Markdown
Author

dnsl48 commented May 20, 2025

@yanganto thank you for looking into this!
I've been doing some tests with 0.10.2 and I noticed that we now have Status::is_empty missing the changes inside nested patches.
I've added a new assertion at the bottom of the tests inside this PR.

@yanganto
Copy link
Copy Markdown
Owner

Thank you. This nesting status is fixed in #101 and released in 0.10.3.

@dnsl48
Copy link
Copy Markdown
Author

dnsl48 commented May 21, 2025

@yanganto thank you, it all seems to be working well now!

@dnsl48 dnsl48 closed this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants