test
test copied to clipboard
Exception not handled when input test file has illegal filename
Running
pub run test 'This is an ***illegal*** filename'
will cause OS Error, which is unhandled.
On linux I see Failed to load "This is an ***illegal*** filename": Does not exist.
, which seems reasonable. What output are you seeing (maybe windows is giving a different exception which isn't handled as nicely)?
Linux accepts '*' as a legal character in filename(in fact, Linux accepts almost any printable characters except the path seperator). So this problem only applies to Windows.
It sounds like we probably need to handle another type of file system exception then? There is likely a try/catch already catching the file does not exist error.
Exception details below (from windows)
Exists failed, path = 'This is an ***Illegal file name** ' (OS Error: The filename, directory name, or volume label syntax is incorrect.
, errno = 123)
dart:io _Directory.existsSync
package:test_core/src/runner/reporter/compact.dart 54:53 new CompactReporter._
package:test_core/src/runner/reporter/compact.dart 104:66 CompactReporter.watch
package:test_core/src/runner/configuration/reporters.dart 41:38 _allReporters.<fn>
package:test_core/src/runner.dart 77:49 new Runner.<fn>
dart:async runZoned
package:test_core/src/runner/configuration.dart 405:31 Configuration.asCurrent
package:test_core/src/runner.dart 73:50 new Runner
package:test_core/src/executable.dart 148:14 _execute
package:test_core/src/executable.dart 40:9 main
package:test/src/executable.dart 22:9 main
This is an unexpected error. Please file an issue at http://github.com/dart-lang/test
with the stack trace and instructions for reproducing the error.
If you are interested in contributing @YizhePKU this would be a relatively easy one, and it would be easiest for you to verify as none of us develop on windows.
Otherwise one of us can grab it when we get a chance.
See pull request #1079