Add a test showing we are not handling exports flags properly.

This commit is contained in:
Tom Alexander 2023-10-04 17:20:46 -04:00
parent a548c7e170
commit 1ab7d2f2d7
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
7 changed files with 22 additions and 4 deletions

View File

@ -46,6 +46,13 @@ dockertest:
> $(MAKE) -C docker/organic_test
> docker run --init --rm -i -t --read-only -v "$$(readlink -f ./):/source:ro" --mount type=tmpfs,destination=/tmp --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test --no-default-features --features compare --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS)
.PHONY: buildtest
buildtest:
> cargo build --no-default-features
> cargo build --no-default-features --features compare
> cargo build --no-default-features --features tracing
> cargo build --no-default-features --features compare,tracing
.PHONY: foreign_document_test
foreign_document_test:
> $(MAKE) -C docker/organic_test run_foreign_document_test

View File

@ -0,0 +1,7 @@
#+begin_example python :exports results
print("foo")
#+end_example
#+begin_example python -n :exports results
print("foo")
#+end_example

View File

@ -0,0 +1,7 @@
#+begin_src python :exports results
print("foo")
#+end_src
#+begin_src python -n :exports results
print("foo")
#+end_src

View File

@ -104,7 +104,7 @@ pub(crate) fn comment_block<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, CommentBlock<'s>> {
let (remaining, name) = lesser_block_begin("comment")(context, input)?;
let (remaining, _name) = lesser_block_begin("comment")(context, input)?;
let (remaining, _parameters) = opt(tuple((space1, data)))(remaining)?;
let (remaining, _nl) = recognize(tuple((space0, line_ending)))(remaining)?;
let lesser_block_end_specialized = lesser_block_end("comment");
@ -128,7 +128,6 @@ pub(crate) fn comment_block<'b, 'g, 'r, 's>(
remaining,
CommentBlock {
source: source.into(),
name: name.into(),
contents: contents.into(),
},
))
@ -384,7 +383,6 @@ fn example_switches<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, ExampleSrcSw
Ok((remaining, switches))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn example_src_switches(
grab_language: bool,
) -> impl for<'s> Fn(OrgSource<'s>) -> Res<OrgSource<'s>, ExampleSrcSwitches<'s>> {

View File

@ -32,7 +32,6 @@ pub struct VerseBlock<'s> {
#[derive(Debug)]
pub struct CommentBlock<'s> {
pub source: &'s str,
pub name: &'s str,
pub contents: &'s str,
}