Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring the CSL test suite to 100% #82

Merged
merged 56 commits into from
Nov 24, 2020
Merged

Bring the CSL test suite to 100% #82

merged 56 commits into from
Nov 24, 2020

Conversation

cormacrelf
Copy link
Collaborator

@cormacrelf cormacrelf commented Nov 24, 2020

There are some caveats, but citeproc-rs now passes the CSL test suite.

The caveats are:

  1. This is my fork of the test suite, so it had a few edits made mostly early on making it less prone to failure on a young CSL implementation. E.g. cleaning up JSON, removing variables that don't exist, etc. It also lacks recent changes in the official CSL test repo, but last I checked some of those changes are the same ones I made.
  2. There are 24 test ignored completely, mostly because they rely on citeproc-js-only APIs or test modes. The ignored tests are listed in crates/citeproc/tests/data/ignore.txt, with justifications for each, but these are all absolutely open to question.
  3. Similarly, 15 tests are "snapshotted", meaning citeproc-rs produces different output that is still considered acceptable. Again, the list is in crates/citeproc/tests/data/snapshot.txt with justifications, and again all are open to question. Probably the most iffy ones are position_IbidInText.txt and locator_TrickyEntryForPlurals.txt, but at least neither of them is actually documented in the specification, so there's that at least.

There are also 23 additional tests in crates/citeproc/tests/data/humans/. This one's not really a caveat, but they're all candidates for test suite inclusion, and if you're reading this then chances are that's interesting to you.

A couple of inextricable Rust API changes landed along the way, ie Processor::new(InitOptions { style, ..Default::default() }), but the wasm API is severable, untouched and for a separate PR.

Edit: oh, and another inextricable change, the parsing a style's metadata only. There's a new csl::StyleMeta with a parse method. You can use this to figure out whether a style is dependent, and what its e.g. default-locale is, to apply to the parent style as an override. Or just to get some info from the style, without erroring out if there are parse errors outside the <info> block. (At least I should add a test for that last use case.)

Who really cares, anyway? That last commit was definitely wrong.
There's none of that hubris around here any more.
title-short should render nothing if there is no explicit title-short
variable in the Reference. title(form=short) can use either, still.
+disambiguate_BasedOnEtAlSubsequent.txt
+bugreports_parseName.txt
+name_ParticleCaps3.txt
+name_EtAlWithCombined.txt
+name_HebrewAnd.txt

Required changing the defn of is_latin_cyrillic to
include Arabic in line with citeproc-js.
+bugreports_SmallCapsEscape.txt
(snapshot because of extraneous space that citeproc-rs eliminates)
It does a better job of sorting with punctuation in there, and is still
case insensitive.

+sort_LeadingApostropheOnNameParticle.txt
+disambiguate_DisambiguateTrueReflectedInBibliography.txt
+variables_ContainerTitleShort.txt
Disable quote parsing for affixes;
Better rendering of unmatched quotes;
Disable flipping in user-supplied cluster affixes.

Improved:
+flipflop_LeadingMarkupWithApostrophe.txt

Un-snapshot:
+bugreports_FourAndFour.txt
+bugreports_SingleQuote.txt
+bugreports_SingleQuoteXml.txt
Syntactically, with the new enums. Also parse_quotes external applies to
curly only.
This is the (Oblinger & Oblinger, 2009) one. It ignores primary name clashes
when they have the same last name, only for NameForm::Short.

New test to check that the original behaviour remains when there are other
names to disambiguate against.
…e-number

If the subsequent form included Frnn, then the bibliography ghosts used
to determine year suffixes having None for Frnn was a problem as they would
render differently from all the other ones. The dummy ends up as a Frnn
edge, which is all that was needed.
By running 'natural + lexical sort' instead of just lexical;
and by not creating fake citation numbers for uncited items.
@cormacrelf cormacrelf merged commit 88f356a into master Nov 24, 2020
@cormacrelf cormacrelf deleted the test-100 branch November 26, 2020 01:23
@cormacrelf cormacrelf added A-core Area: affects all builds of citeproc-rs A-crates/csl Area: csl crate A-crates/citeproc Area: citeproc crate breaking Breaking change labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs A-crates/citeproc Area: citeproc crate A-crates/csl Area: csl crate breaking Breaking change
Development

Successfully merging this pull request may close these issues.

None yet

1 participant