-
-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove whitespace before a command in dialogue option (#2187)
Previously, a line such as -> Choice 1 <<if $condition>> would generate text "Choice 1 " (with an extra space at the end), this is now fixed. Also added several tests from the Yarn integration testing suite.
- Loading branch information
Showing
6 changed files
with
218 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/flame_jenny/jenny/test/structure/expressions/arithmetic_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:test/test.dart'; | ||
|
||
import '../../test_scenario.dart'; | ||
|
||
void main() { | ||
group('arithmetic operations', () { | ||
testScenario( | ||
testName: 'Expressions.yarn', | ||
input: r''' | ||
<<declare $int = 0>> | ||
<<declare $bool = true>> | ||
<<declare $math = 0>> | ||
--- | ||
title: Start | ||
--- | ||
// Expression testing | ||
<<set $int to 1>> | ||
1. {$int == 1} | ||
2. {$int != 2} | ||
// Test unary operators | ||
3. {!$bool == false} | ||
4. {-$int == -1} | ||
5. {-$int == 0 - 1} | ||
// Test more complex expressions | ||
<<set $math = 5 * 2 - 2 * -1 >> | ||
6. {$math is 12} | ||
// Test % operator | ||
<<set $math = 12 >> | ||
<<set $math = $math % 5 >> | ||
7. {$math is 2} | ||
// Test floating point math | ||
8. {1 / 2 == 0.5} | ||
9. {0.1 + 0.1 == 0.2} | ||
=== | ||
''', | ||
testPlan: ''' | ||
line: 1. true | ||
line: 2. true | ||
line: 3. true | ||
line: 4. true | ||
line: 5. true | ||
line: 6. true | ||
line: 7. true | ||
line: 8. true | ||
line: 9. true | ||
''', | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters