Skip to content

Commit

Permalink
fix flutter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derdilla committed Jul 27, 2024
1 parent 38f0e01 commit 9efbc15
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion apps/calculator/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
void main() {}
import 'package:flutter_test/flutter_test.dart';

void main() {
test('TODO: test calculator app',(){});
}
4 changes: 2 additions & 2 deletions apps/rewordle/lib/persistence.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class GameState {
return '$correctWord|$wrongLetters|$wrongPosLetters|$okLetters|$submissionsString';
}

String? addWord(String word) {
String? addWord(String word, [bool skipWordListValidation = false]) {
final letters = word.split('');
if (letters.length != 5) return 'Not 5 letters long';
if (!VALID_WORDS.contains(word)) return 'Not in word list';
if (!(skipWordListValidation || VALID_WORDS.contains(word))) return 'Not in word list';
final correct = correctWord.split('');

final checked = <LetterData>[];
Expand Down
4 changes: 2 additions & 2 deletions apps/rewordle/test/persistence_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void main() {
});
test('determines letters at correct positions and not in word', () {
final s = GameState('AAAAA');
expect(s.addWord('ABBAA'), isNull);
expect(s.addWord('ABBAA', true), isNull);

expect(s.submitted[0][0].state, LetterCorrectness.ok);
expect(s.submitted[0][1].state, LetterCorrectness.err);
Expand All @@ -31,7 +31,7 @@ void main() {
});
test('determines letters at wrong positions', () {
final s = GameState('ABCDE');
expect(s.addWord('XCXEE'), isNull);
expect(s.addWord('XCXEE', true), isNull);

expect(s.submitted[0][0].state, LetterCorrectness.err);
expect(s.submitted[0][1].state, LetterCorrectness.warn);
Expand Down
6 changes: 5 additions & 1 deletion packages/app_base/test/app_base_test.dart
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
void main() {}
import 'package:flutter_test/flutter_test.dart';

void main() {
test('TODO: test app_base package',(){});
}
4 changes: 3 additions & 1 deletion packages/file_entry/test/file_entry_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:flutter_test/flutter_test.dart';

void main() {
// TODO
test('TODO: test file_entry package',(){});
}

0 comments on commit 9efbc15

Please sign in to comment.