mirror of https://github.com/tc39/test262.git
Update filename character restriction in documention, linter and a few filenames
This commit is contained in:
parent
8d7dd538f1
commit
40883f4c6a
|
@ -10,7 +10,7 @@
|
|||
|
||||
Test cases should be created in files that are named to identify the feature or API that's being tested.
|
||||
|
||||
There is no strict naming convention. The file names should be human readable, helpful and, ideally, consistent within a single directory. For examples:
|
||||
The names should use alphanumeric characters and `.`, `-`, `_`. Otherwise, there is no strict naming convention, but the file names should be human readable, helpful and, ideally, consistent within a single directory. For examples:
|
||||
|
||||
- `Math.fround` handling of `Infinity`: `test/built-ins/Math/fround/Math.fround_Infinity.js`
|
||||
- `Array.prototype.find` use with `Proxy`: `test/built-ins/Array/prototype/find/Array.prototype.find_callable-Proxy-1.js`
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import re
|
||||
|
||||
from ..check import Check
|
||||
|
||||
_DISALLOWED_PATTERN = re.compile('[^a-zA-Z0-9/\\-_.]')
|
||||
|
||||
class CheckFileName(Check):
|
||||
'''Ensure tests have a valid name.'''
|
||||
ID = 'FILENAME'
|
||||
|
||||
def run(self, name, meta, source):
|
||||
if _DISALLOWED_PATTERN.search(name):
|
||||
return "Contains non-alphanumeric or `-`, `_`, '.' characters."
|
|
@ -32,6 +32,7 @@ from lib.checks.frontmatter import CheckFrontmatter
|
|||
from lib.checks.harnessfeatures import CheckHarnessFeatures
|
||||
from lib.checks.license import CheckLicense
|
||||
from lib.checks.negative import CheckNegative
|
||||
from lib.checks.filename import CheckFileName
|
||||
from lib.eprint import eprint
|
||||
import lib.frontmatter
|
||||
import lib.whitelist
|
||||
|
@ -46,6 +47,7 @@ parser.add_argument('path',
|
|||
|
||||
checks = [
|
||||
CheckEsid(),
|
||||
CheckFileName(),
|
||||
CheckFrontmatter(),
|
||||
CheckFeatures('features.txt'),
|
||||
CheckHarnessFeatures(),
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
FILENAME
|
||||
^ expected errors | v input
|
||||
// Copyright (c) 2018 Valerie Young. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-assignment-operators-static-semantics-early-errors
|
||||
description: Minimal test
|
||||
---*/
|
||||
|
||||
void 0;
|
Loading…
Reference in New Issue