Merge branch 'foreign_document_literate_build_emacs'
This commit is contained in:
commit
93cfa71df2
@ -93,6 +93,12 @@ ARG WORG_PATH=/foreign_documents/worg
|
|||||||
ARG WORG_REPO=https://git.sr.ht/~bzg/worg
|
ARG WORG_REPO=https://git.sr.ht/~bzg/worg
|
||||||
RUN mkdir -p $WORG_PATH && git -C $WORG_PATH init --initial-branch=main && git -C $WORG_PATH remote add origin $WORG_REPO && git -C $WORG_PATH fetch origin $WORG_VERSION && git -C $WORG_PATH checkout FETCH_HEAD
|
RUN mkdir -p $WORG_PATH && git -C $WORG_PATH init --initial-branch=main && git -C $WORG_PATH remote add origin $WORG_REPO && git -C $WORG_PATH fetch origin $WORG_VERSION && git -C $WORG_PATH checkout FETCH_HEAD
|
||||||
|
|
||||||
|
ARG LITERATE_BUILD_EMACS_VERSION=e3ac1afe1e40af601be7af12c1d13d96308ab209
|
||||||
|
ARG LITERATE_BUILD_EMACS_PATH=/foreign_documents/literate_build_emacs
|
||||||
|
ARG LITERATE_BUILD_EMACS_REPO=https://gitlab.com/spudlyo/orgdemo2.git
|
||||||
|
RUN mkdir -p $LITERATE_BUILD_EMACS_PATH && git -C $LITERATE_BUILD_EMACS_PATH init --initial-branch=main && git -C $LITERATE_BUILD_EMACS_PATH remote add origin $LITERATE_BUILD_EMACS_REPO && git -C $LITERATE_BUILD_EMACS_PATH fetch origin $LITERATE_BUILD_EMACS_VERSION && git -C $LITERATE_BUILD_EMACS_PATH checkout FETCH_HEAD
|
||||||
|
# unused/aws.org contains invalid paths for setupfile which causes both upstream org-mode and Organic to error out.
|
||||||
|
RUN rm $LITERATE_BUILD_EMACS_PATH/unused/aws.org
|
||||||
|
|
||||||
FROM tester as foreign-document-test
|
FROM tester as foreign-document-test
|
||||||
RUN apk add --no-cache bash coreutils
|
RUN apk add --no-cache bash coreutils
|
||||||
@ -100,6 +106,7 @@ RUN mkdir /foreign_documents
|
|||||||
COPY --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams
|
COPY --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams
|
||||||
COPY --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs
|
COPY --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs
|
||||||
COPY --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg
|
COPY --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg
|
||||||
|
COPY --from=foreign-document-gather /foreign_documents/literate_build_emacs /foreign_documents/literate_build_emacs
|
||||||
COPY --from=build-org-mode /root/org-mode /foreign_documents/org-mode
|
COPY --from=build-org-mode /root/org-mode /foreign_documents/org-mode
|
||||||
COPY --from=build-emacs /root/emacs /foreign_documents/emacs
|
COPY --from=build-emacs /root/emacs /foreign_documents/emacs
|
||||||
ENTRYPOINT ["cargo", "run", "--bin", "foreign_document_test", "--features", "compare,foreign_document_test", "--profile", "release-lto"]
|
ENTRYPOINT ["cargo", "run", "--bin", "foreign_document_test", "--features", "compare,foreign_document_test", "--profile", "release-lto"]
|
||||||
|
5
org_mode_samples/affiliated_keyword/empty_caption.org
Normal file
5
org_mode_samples/affiliated_keyword/empty_caption.org
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#+caption:
|
||||||
|
#+caption: *foo*
|
||||||
|
#+caption[bar]:
|
||||||
|
#+begin_src bash
|
||||||
|
#+end_src
|
@ -53,6 +53,9 @@ async fn main_body() -> Result<ExitCode, Box<dyn std::error::Error>> {
|
|||||||
let layer = layer.chain(compare_group("doomemacs", || {
|
let layer = layer.chain(compare_group("doomemacs", || {
|
||||||
compare_all_org_document("/foreign_documents/doomemacs")
|
compare_all_org_document("/foreign_documents/doomemacs")
|
||||||
}));
|
}));
|
||||||
|
let layer = layer.chain(compare_group("literate_build_emacs", || {
|
||||||
|
compare_all_org_document("/foreign_documents/literate_build_emacs")
|
||||||
|
}));
|
||||||
|
|
||||||
let running_tests: Vec<_> = layer.map(|c| tokio::spawn(c.run_test())).collect();
|
let running_tests: Vec<_> = layer.map(|c| tokio::spawn(c.run_test())).collect();
|
||||||
let mut any_failed = false;
|
let mut any_failed = false;
|
||||||
|
@ -548,6 +548,21 @@ where
|
|||||||
let mut full_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(outer_rust_list.len());
|
let mut full_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(outer_rust_list.len());
|
||||||
|
|
||||||
for (kw_e, kw_r) in outer_emacs_list.iter().zip(outer_rust_list) {
|
for (kw_e, kw_r) in outer_emacs_list.iter().zip(outer_rust_list) {
|
||||||
|
match (kw_e.as_atom(), kw_r) {
|
||||||
|
(Ok("nil"), (None, mandatory_value)) if mandatory_value.is_empty() => {
|
||||||
|
// If its an empty keyword then it becomes nil in the elisp.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
(Ok("nil"), _) => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, kw_e, kw_r
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
let kw_e = kw_e.as_list()?;
|
let kw_e = kw_e.as_list()?;
|
||||||
let child_status_length = kw_r.1.len() + kw_r.0.as_ref().map(|opt| opt.len()).unwrap_or(0);
|
let child_status_length = kw_r.1.len() + kw_r.0.as_ref().map(|opt| opt.len()).unwrap_or(0);
|
||||||
let mut child_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(child_status_length);
|
let mut child_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(child_status_length);
|
||||||
@ -556,18 +571,31 @@ where
|
|||||||
let mut kw_e = kw_e.iter();
|
let mut kw_e = kw_e.iter();
|
||||||
// First element is a list representing the mandatory value.
|
// First element is a list representing the mandatory value.
|
||||||
if let Some(val_e) = kw_e.next() {
|
if let Some(val_e) = kw_e.next() {
|
||||||
let el = val_e.as_list()?;
|
match (val_e.as_atom(), kw_r) {
|
||||||
if el.len() != kw_r.1.len() {
|
(Ok("nil"), (_, mandatory_value)) if mandatory_value.is_empty() => {}
|
||||||
let this_status = DiffStatus::Bad;
|
(Ok("nil"), _) => {
|
||||||
let message = Some(format!(
|
let this_status = DiffStatus::Bad;
|
||||||
"{} mismatch (emacs != rust) {:?} != {:?}",
|
let message = Some(format!(
|
||||||
emacs_field, kw_e, kw_r
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
));
|
emacs_field, kw_e, kw_r
|
||||||
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
));
|
||||||
}
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
for (e, r) in el.iter().zip(kw_r.1.iter()) {
|
}
|
||||||
child_status.push(compare_ast_node(source, e, r.into())?);
|
_ => {
|
||||||
}
|
let el = val_e.as_list()?;
|
||||||
|
if el.len() != kw_r.1.len() {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, kw_e, kw_r
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
for (e, r) in el.iter().zip(kw_r.1.iter()) {
|
||||||
|
child_status.push(compare_ast_node(source, e, r.into())?);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
let this_status = DiffStatus::Bad;
|
let this_status = DiffStatus::Bad;
|
||||||
let message = Some(format!(
|
let message = Some(format!(
|
||||||
|
@ -244,7 +244,7 @@ mod tests {
|
|||||||
let input = OrgSource::new("()");
|
let input = OrgSource::new("()");
|
||||||
let (remaining, call) = opt(babel_call_call)(input)?;
|
let (remaining, call) = opt(babel_call_call)(input)?;
|
||||||
assert_eq!(Into::<&str>::into(remaining), "()");
|
assert_eq!(Into::<&str>::into(remaining), "()");
|
||||||
assert!(matches!(call, None));
|
assert!(call.is_none());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ mod tests {
|
|||||||
assert_eq!(inner.children.len(), 1);
|
assert_eq!(inner.children.len(), 1);
|
||||||
let child = inner
|
let child = inner
|
||||||
.children
|
.children
|
||||||
.get(0)
|
.first()
|
||||||
.expect("Length already asserted to be 1.");
|
.expect("Length already asserted to be 1.");
|
||||||
assert!(matches!(child, Object::PlainText(_)));
|
assert!(matches!(child, Object::PlainText(_)));
|
||||||
assert_eq!(child.get_standard_properties().get_source(), "bar");
|
assert_eq!(child.get_standard_properties().get_source(), "bar");
|
||||||
@ -260,7 +260,7 @@ mod tests {
|
|||||||
assert_eq!(inner.children.len(), 1);
|
assert_eq!(inner.children.len(), 1);
|
||||||
let child = inner
|
let child = inner
|
||||||
.children
|
.children
|
||||||
.get(0)
|
.first()
|
||||||
.expect("Length already asserted to be 1.");
|
.expect("Length already asserted to be 1.");
|
||||||
assert!(matches!(child, Object::Bold(_)));
|
assert!(matches!(child, Object::Bold(_)));
|
||||||
assert_eq!(child.get_standard_properties().get_source(), "*bar* ");
|
assert_eq!(child.get_standard_properties().get_source(), "*bar* ");
|
||||||
@ -270,20 +270,5 @@ mod tests {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
||||||
// assert_eq!(
|
|
||||||
// first_paragraph
|
|
||||||
// .children
|
|
||||||
// .get(1)
|
|
||||||
// .expect("Len already asserted to be 3"),
|
|
||||||
// &Object::RadioLink(RadioLink {
|
|
||||||
// source: "*bar* ",
|
|
||||||
// children: vec![Object::Bold(Bold {
|
|
||||||
// source: "*bar* ",
|
|
||||||
// children: vec![Object::PlainText(PlainText { source: "bar" })]
|
|
||||||
// })],
|
|
||||||
// path: "*bar* "
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user