Skip to content

Conversation

@stasm
Copy link
Contributor

@stasm stasm commented Mar 30, 2017

Behavior Tests

FTL files which may include special markup with the information about the expected error. The test runner uses a preprocessor to parse and remove the error annotation from the file. If there is no error annotation, the file is expected to parse without errors.

Structure Tests

FTL + JSON AST pairs. JSON files are generated via make fixtures and reviewed by a human. The test runner compares the output of the parser against the saved AST.

@stasm stasm requested review from Pike and zbraniecki March 30, 2017 22:42
@stasm stasm force-pushed the test-fixtures branch 2 times, most recently from 1ca87ba to 6fdda60 Compare March 31, 2017 09:46
}
}

function getErrorMessage(code, args) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list of errors comes from https://github.com/projectfluent/fluent-rs/blob/master/src/syntax/errors/list.rs. It's a first draft and I'm sure the list will change and expand as we start writing more tests.

}

addSpan(start, end) {
this.span = new Span(start, end);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed projectfluent/fluent#40 for ASDL changes.

    Behavior Tests

FTL files which may include special markup with the information about the
expected error. The test runner uses a preprocessor to parse and remove the
error annotation from the file. If there is no error annotation, the file is
expected to parse without errors.

    Structure Tests

FTL + JSON AST pairs. JSON files are generated via `make fixtures` and reviewed
by a human. The test runner compares the output of the parser against the saved
AST.
Copy link
Contributor

@Pike Pike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To leave the comment here that I did in real life.

I made the test fail, and compared that to how the similar test infrastructure in mercurial fails. The nice feature there is that you see the failure in the format that the test is written in.

Stas' is working on reworking the details of the behavior tests to serialize the annotation data into the format in the test, instead of parsing the comment into an annotation subset object.

@stasm stasm requested a review from Pike March 31, 2017 17:13
@stasm stasm merged commit 4f343fe into projectfluent:master Apr 3, 2017
@stasm stasm deleted the test-fixtures branch April 3, 2017 17:19
@stasm stasm mentioned this pull request Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants