feat: add mdbook plugin for testing mun code in book#263
feat: add mdbook plugin for testing mun code in book#263Wodann merged 1 commit intomun-lang:masterfrom
Conversation
|
Also need to mention that this pr skip testing one code from chapter |
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
==========================================
- Coverage 79.10% 78.82% -0.28%
==========================================
Files 219 220 +1
Lines 13024 13070 +46
==========================================
Hits 10303 10303
- Misses 2721 2767 +46
Continue to review full report at Codecov.
|
Wodann
left a comment
There was a problem hiding this comment.
Nice work @legendiguess. Very happy with this addition. I've added some minor remarks, but mostly it looks good to go.
Could you also remove book/listings/ch03-structs/mun.exe? It's not necessary to have that committed 🙂
|
@legendiguess I see that you performed a merge. In the future, please do "rebase merges" instead. If you are unfamiliar with rebase merges, our contributing guidelines explain it in more detail here. |
Oh, sorry, it's was just due to my inexperience, i removed merge 👍 |
|
@legendiguess Do you need any help to fix the last couple of issues? |
427f974 to
cbc2a0d
Compare
Wodann
left a comment
There was a problem hiding this comment.
That looks a lot better. I recommended a few changes, because:
- I think we should use
no_runinstead ofrun. I explained why in one of the comments inmain.rs
This means that by default, we always run the Mun source code, unless you specifyno_run. - After looking at our CLI source code, it seems that just using
pub fn mainas the entry point for Mun source is the best option. That's the same for our mdbook plugin and the Mun CLI then. - I think we don't need
skipanymore, now that the compiler bug is fixed. - I think
compile_failshould always mean that nothing will run.
| value, explicit `return` statements always return from the entire function: | ||
|
|
||
| ```mun | ||
| ```mun,ignore |
There was a problem hiding this comment.
| ```mun,ignore | |
| ```mun |
There was a problem hiding this comment.
This should compile if you convert return bar + 3; into return 3;, I think
There was a problem hiding this comment.
Shouldn't it be a separate pr?
This pull request add mdbook plugin that's test all mun code(indicated by keyword
munbefore code block).Also, plugin allows to specify "testing method" for each code block by using keywords
no_run,compile_failandskip.Example:
mun,no_run,mun,compile_failand etcWith this pull request, plugin already setted as dependency for mun book, so before building new version of book by
mdbook buildone need to compilemdbook-mun-examples-testcrate and add it's executable file to environment variables.closes #209