- A large number of tests test functionality that is not in the CSL
but is provided by citeproc-js (raw dates, static ordering, literal
…). I think these should be indicated as such, or perhaps moved to a
separate directory. This would make it easier to check the other CSL
Sylvester Keil proposed using a Cucumber format for unit tests, which
would allow tests to be tagged:
If somebody else helps with the technical infrastructure, I’d be happy
to help reclassifying the existing unit tests.
I’ve moved quite a few citeproc-js-specific tests out of the archive,
but I’ve obviously not caught them all: I’ll fix up the tests with
numeric page and page-first. If there are others that don’t belong
there, please call attention to them, and I’ll pull them out.
Here’s a short list I have ready. The following tests use raw/literal
- date_Accessed (raw)
- date_InPress (literal)
- date_LoneJapaneseMonth (raw)
- date_LopsidedDataYearSuffixCollapse (raw)
- date_OtherWithDate (season)
- date_RawParseSimpleDate (raw)
- date_RawSeasonRange1 (raw)
- date_RawSeasonRange2 (raw)
- date_RawSeasonRange3 (raw)
- date_String (raw)
It might be valuable to convert the raw dates to the structured format, so
the tests can be used by all CSL processors. But I assume you will want to
keep testing the citeproc-js raw date parser? I would suggest separating
these tests from the rendering tests, testing only the conversion from raw
to structured dates.
The suite does need attention. It would be really good to recast the
tests in a more manageable form, and Cucumber seems to be the best
candidate going. We may be able to automate the conversion, but the
tests should really be individually reviewed, commented, tagged and
stripped down to their essentials. It will be a lot of work.
What is the problem with the current test format? It can be easily
extended to support adding tags.
I’m not sure I see the benefit of moving to Cubumber. There are only a
small number of different scenarios (citation, note, bibliography). It’s
basically only the input/style data that differs between tests. Also note
that there’s no real flow (steps) in the citeproc tests, which seems to be
central in Cucumber tests.
Cucumber would introduce a dependency on Ruby, making it more difficult to
support by non-Ruby citeprocs. That said, it would be good to get rid of
the Python dependency of the current test suite. However, the ‘human’ test
files should be rather easy to parse, so the conversion step might not be
If you insist on dropping the current test format, may I suggest YAML as
an alternative? YAML is easy to write and read and has parsers for most
platforms. It would not require the extra conversion step (human ->
Here’s date_InPress in YAML format as an example:
(John Doe (in press))
- family: Doe
literal: (in press)
Note that you don’t need to quote strings and can include the XML as is
(no escaping). This translates into the current JSON format (try
Conversion from the current format files can be largely automated.