fix: parser tests (#134)

This commit is contained in:
James Collins
2025-08-20 11:44:32 +12:00
committed by GitHub
parent 5997a6853a
commit 79d6bd2cba
3 changed files with 64 additions and 64 deletions

View File

@ -19,20 +19,20 @@ void main() {
});
test('it strips trailing comments', () {
var out = psr.strip(
var out = psr.removeCommentsFromLine(
'needs="explanation" # It was the year when they finally immanentized the Eschaton.');
expect(out, equals('needs="explanation"'));
out = psr.strip(
out = psr.removeCommentsFromLine(
'needs="explanation # It was the year when they finally immanentized the Eschaton." ');
expect(
out,
equals(
'needs="explanation # It was the year when they finally immanentized the Eschaton."'));
out = psr.strip(
out = psr.removeCommentsFromLine(
'needs=explanation # It was the year when they finally immanentized the Eschaton."',
includeQuotes: true);
expect(out, equals('needs=explanation'));
out = psr.strip(' # It was the best of times, it was a waste of time.');
out = psr.removeCommentsFromLine(' # It was the best of times, it was a waste of time.');
expect(out, isEmpty);
});
test('it knows quoted # is not a comment', () {