Has anyone got the tests to work? #46
-
When using
Did anyone get this to work and might be able to help me out? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Docs for reference: https://github.com/DioxusLabs/stretch#testing |
Beta Was this translation helpful? Give feedback.
-
For future readers, this is discussed further in #45. |
Beta Was this translation helpful? Give feedback.
-
I've hit a different error while trying to use this tool:
Extra things I needed to install were |
Beta Was this translation helpful? Give feedback.
-
This isn't a direct answer to this - although I've tried generating the tests but couldn't also get it to work. While working on my Kotlin port of this same library, I decided to automatically generate the tests myself, based on those same Yoga test files, but while doing so, I came across some inconsistencies with the results given by Sprawl and the ones given by a Chrome browser. For full transparency, here's the Chrome version I am using:
A test that shows me these kinds of inconsistencies is the min_height test. Comparison of results in min_heightJust to make my point (and suffering) clear, here's my comparison of the assertions vs what Chrome tells me. Root elementassert_eq!(sprawl.layout(node).unwrap().size.width, 100f32);
assert_eq!(sprawl.layout(node).unwrap().size.height, 100f32);
assert_eq!(sprawl.layout(node).unwrap().location.x, 0f32);
assert_eq!(sprawl.layout(node).unwrap().location.y, 0f32);
Root's first child (node 0)assert_eq!(sprawl.layout(node0).unwrap().size.width, 100f32);
assert_eq!(sprawl.layout(node0).unwrap().size.height, 80f32);
assert_eq!(sprawl.layout(node0).unwrap().location.x, 0f32);
assert_eq!(sprawl.layout(node0).unwrap().location.y, 0f32);
ConclusionI think it's that time of the year to fix the test generation and regenerate those tests and make sure we're still up-to-spec. Please someone help, I've spent 3 hours yesterday trying to debug this issue. |
Beta Was this translation helpful? Give feedback.
-
Update on this: @mockersf has helpfully fixed the gentest now in #145, and I have improved the error message in #147 As a policy: Whenever making changes / refactors that affects these, please run the gentest at the end then commit them separately so that the PR can be reviewed by commit without all the noise. |
Beta Was this translation helpful? Give feedback.
This isn't a direct answer to this - although I've tried generating the tests but couldn't also get it to work.
While working on my Kotlin port of this same library, I decided to automatically generate the tests myself, based on those same Yoga test files, but while doing so, I came across some inconsistencies with the results given by Sprawl and the ones given by a Chrome browser.
For full transparency, here's the Chrome version I am using:
A test that shows me these kinds of inconsistencies is the min_height test.
Comparison of results in min_height
Just to make my point (and suffering) clear, here's my comparison of…