exercism / exercism/dart-test-runner
Bob Test Failing Online
- Dominant language
- Shell
- Stars
- 2
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
The unit test are passing locally. Getting the following error online:
```
An error occurred while running your tests. This might mean that there was an issue in our infrastructure,
or it might mean that you have something in your code that's causing our systems to break.
Please check your code, and if nothing seems to be wrong, try running the tests again.
```
`dart pub upgrade --precompile && dart run test --run-skipped` returns: `00:00 +25: All tests passed!`
`dart --version` returns `Dart SDK version: 2.13.4 (stable) (Wed Jun 23 13:08:41 2021 +0200) on "macos_x64"`
My solution follows:
```dart
class Bob {
String response(String s) {
s = s.trim();
var hasLetters = RegExp(r"[A-Za-z]+").hasMatch(s);
var isYelling = hasLetters && s == s.toUpperCase();
var isQuestion = s.endsWith("?");
if (s.isEmpty) return 'Fine. Be that way!';
if (isYelling && isQuestion) return "Calm down, I know what I'm doing!";
if (isYelling) return 'Whoa, chill out!';
if (isQuestion) return "Sure.";
return "Whatever.";
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.