Skip to content

Commit

Permalink
Test fix (#227)
Browse files Browse the repository at this point in the history
* Fix save data test

* Fix sequence test

* Add release notes
  • Loading branch information
ruskakimov authored Aug 20, 2021
1 parent 70b8175 commit 984ee36
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 44 deletions.
2 changes: 1 addition & 1 deletion codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ workflows:
- [email protected]
google_play:
credentials: Encrypted(Z0FBQUFBQmhBLUI2M0dCVlBCLTkzSzdkYURsVkZyZFFzVkhIWmhwdTR0a29mR3ljU0JqUUFXSi16TmFhR1EtZVVsY0FJT0RzZDQ5cFlhMzc4R01KakVSd3RJS2tsTjduUFBEXzR0eUFHQzM1bWF1VlBGNTh1c1c1WFdQUFhybURNS0VFblVwNGZNbGFSc0NQR0UtbmJDVVZEZFhGS0FKZHZxc3h2T2cxOVhFN1NKX2dybm1UYzBnTGlhV19zdnhITXpwUEtZMVpUMGpwNHFoMkRfWnd1RWdCY3JWQlFUYTNuMk51UWdhNy1UdnhmWmkwN1NfcWpnV3dpY25adHB3RjQtV3RqUWVRdlhab1p5aldQa2M0WWZXTGV0RE96TUJSN0hQdHJLNXc3cUx2Ym9zZkpKd29CRHBuR2dIbDhZTkZ6dHh5REVhbkVjb0ZFaW1INGpEa256bkNQUEczN3lKLVc3cnkxRDJJNDNEaW1XX3ZIQ3BZNHRvUFBkVF9zcHpJV3MyLUFYcU5MYlBDUkZqazdzbkxoZzRYY0Q5S2ZGbHI1NUk4ckpNenhKbmVZUFJ4dDJQRmxlZ0NXcU9ISWlrMmkxX1didEJVSXUwTnVIR1ZwZlJCZkRleGJCdzE3VUhSQzhfSUd2Y1dRd1BDVDBpcmxLY2J2NmE1ZUZRbDVrLWljNW5SSkZNb1ZCcjhuUjdobkxkNFljVm5KTlhmNXFRVVh6VDVVNFJrcmpUX1FlaU9HUFZLRFR5V05UTFJOaHpGX2ZRa29jMGgtQWVwaTdHZF9zcWlraG0wSkpELXl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2ZVgzRTdQNUN3cGpUbGN0NktMbWZ6YklUc0FXSGFhQnFEaUc1SXpRMVNjaWY4M2ZxUERkUWN3Nmh5a044ei0wMFBDTlQ1VXhIQjd1UGFHd0VrRllRNHF0aE94RmJmNVl1NkIyNVhuNlUxbDMwZlV6YUhHbG5CcmdqM3otTEhxTUhDNVczZlNvOHJGakVlMDAyMmlNRUFQY0lMMWU4clZ5YVR1RjNJQzJDdUIzbFlpTjVEaktfZ0p4VFZTdDk4TTBiUlVWRHhsanoyUzgwcThsdlNKOGVMQnZSZzJfakRlVzNZczc1RHFPckR6TVVFaHZXSDgtSzNTX2M3MmlBTHB5SzlqekkwYm54NEVXN0R3PT0=)
track: internal
track: beta
in_app_update_priority: 0
app_store_connect:
api_key: $APP_STORE_CONNECT_PRIVATE_KEY
Expand Down
2 changes: 2 additions & 0 deletions release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Quickly adjust animation speed
- Improve frame/scene duration label
8 changes: 4 additions & 4 deletions test/project_data/b_v1_13.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"frames": [
{
"file_name": "frame1620719994150.png",
"duration": "0:00:00.100000"
"duration": "0:00:00.120000"
},
{
"file_name": "frame1620720004265.png",
Expand All @@ -42,7 +42,7 @@
"name": "background"
}
],
"duration": "0:00:01.540000",
"duration": "0:00:01.560000",
"description": "Hello"
},
{
Expand All @@ -62,7 +62,7 @@
"frames": [
{
"file_name": "frame1620727959144.png",
"duration": "0:00:00.100000"
"duration": "0:00:00.120000"
},
{
"file_name": "frame1620727959153.png",
Expand Down Expand Up @@ -94,7 +94,7 @@
"frames": [
{
"file_name": "frame1620728099764.png",
"duration": "0:00:00.140000"
"duration": "0:00:00.160000"
},
{
"file_name": "frame1620728186420.png",
Expand Down
8 changes: 4 additions & 4 deletions test/project_data/b_v1_6.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"frames": [
{
"file_name": "frame1620719994150.png",
"duration": "0:00:00.100000"
"duration": "0:00:00.120000"
},
{
"file_name": "frame1620720004265.png",
Expand All @@ -39,7 +39,7 @@
"visible": true
}
],
"duration": "0:00:01.540000",
"duration": "0:00:01.560000",
"description": "Hello"
},
{
Expand All @@ -58,7 +58,7 @@
"frames": [
{
"file_name": "frame1620727959144.png",
"duration": "0:00:00.100000"
"duration": "0:00:00.120000"
},
{
"file_name": "frame1620727959153.png",
Expand Down Expand Up @@ -88,7 +88,7 @@
"frames": [
{
"file_name": "frame1620728099764.png",
"duration": "0:00:00.140000"
"duration": "0:00:00.160000"
},
{
"file_name": "frame1620728186420.png",
Expand Down
70 changes: 35 additions & 35 deletions test/sequence_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ void main() {
TestSpan(Duration(milliseconds: 240)),
TestSpan(Duration(milliseconds: 760)),
TestSpan(Duration(seconds: 12)),
TestSpan(Duration(milliseconds: 20)),
TestSpan(Duration(milliseconds: 40)),
]);
expect(
seq.totalDuration,
Duration(seconds: 13, milliseconds: 20),
Duration(seconds: 13, milliseconds: 40),
);
});

Expand Down Expand Up @@ -100,84 +100,84 @@ void main() {
test('handles inserting at current index', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 120)),
TestSpan(Duration(milliseconds: 260)),
TestSpan(Duration(milliseconds: 240)),
]);
seq.playhead = Duration(milliseconds: 100);
seq.playhead = Duration(milliseconds: 80);
expect(seq.currentIndex, 0);
seq.insert(0, TestSpan(Duration(milliseconds: 60)));
seq.insert(0, TestSpan(Duration(milliseconds: 40)));
expect(seq.length, 3);
expect(seq.currentIndex, 1);
expect(seq.playhead, Duration(milliseconds: 160));
expect(seq.playhead, Duration(milliseconds: 120));
});

test('handles removing current span', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 100)),
TestSpan(Duration(milliseconds: 200)),
TestSpan(Duration(milliseconds: 300)),
TestSpan(Duration(milliseconds: 120)),
TestSpan(Duration(milliseconds: 240)),
TestSpan(Duration(milliseconds: 360)),
]);
seq.playhead = Duration(milliseconds: 150);
seq.playhead = Duration(milliseconds: 160);
expect(seq.currentIndex, 1);
seq.removeAt(1);
expect(seq.playhead, Duration(milliseconds: 100));
expect(seq.playhead, Duration(milliseconds: 120));
expect(seq.currentIndex, 1);
expect(seq.length, 2);
});

test('handles replacing current span with longer one', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 100)),
TestSpan(Duration(milliseconds: 200)),
TestSpan(Duration(milliseconds: 300)),
TestSpan(Duration(milliseconds: 120)),
TestSpan(Duration(milliseconds: 240)),
TestSpan(Duration(milliseconds: 360)),
]);
seq.playhead = Duration(milliseconds: 150);
seq.playhead = Duration(milliseconds: 160);
expect(seq.currentIndex, 1);
expect(seq.totalDuration, Duration(milliseconds: 600));
seq[1] = TestSpan(Duration(milliseconds: 500));
expect(seq.totalDuration, Duration(milliseconds: 720));
seq[1] = TestSpan(Duration(milliseconds: 400));
expect(seq.currentIndex, 1);
expect(seq.playhead, Duration(milliseconds: 150));
expect(seq.totalDuration, Duration(milliseconds: 900));
expect(seq.playhead, Duration(milliseconds: 160));
expect(seq.totalDuration, Duration(milliseconds: 880));
});

test('handles replacing current span with shorter one', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 100)),
TestSpan(Duration(milliseconds: 200)),
TestSpan(Duration(milliseconds: 300)),
TestSpan(Duration(milliseconds: 120)),
TestSpan(Duration(milliseconds: 240)),
TestSpan(Duration(milliseconds: 360)),
]);
seq.playhead = Duration(milliseconds: 150);
seq.playhead = Duration(milliseconds: 160);
expect(seq.currentIndex, 1);
expect(seq.totalDuration, Duration(milliseconds: 600));
seq[1] = TestSpan(Duration(milliseconds: 20));
expect(seq.totalDuration, Duration(milliseconds: 720));
seq[1] = TestSpan(Duration(milliseconds: 40));
expect(seq.currentIndex, 2);
expect(seq.playhead, Duration(milliseconds: 150));
expect(seq.totalDuration, Duration(milliseconds: 420));
expect(seq.playhead, Duration(milliseconds: 160));
expect(seq.totalDuration, Duration(milliseconds: 520));
});

test('handles replacing span before current with shorter one', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 740)),
TestSpan(Duration(milliseconds: 800)),
TestSpan(Duration(milliseconds: 160)),
TestSpan(Duration(milliseconds: 100)),
TestSpan(Duration(milliseconds: 80)),
]);
seq.playhead = Duration(milliseconds: 800);
expect(seq.currentIndex, 1);
expect(seq.totalDuration, Duration(milliseconds: 1000));
seq[0] = TestSpan(Duration(milliseconds: 20));
expect(seq.totalDuration, Duration(milliseconds: 1040));
seq[0] = TestSpan(Duration(milliseconds: 40));
expect(seq.currentIndex, 2);
expect(seq.playhead, Duration(milliseconds: 800));
expect(seq.totalDuration, Duration(milliseconds: 280));
});

test('handles replacing span before current with longer one', () {
final seq = Sequence([
TestSpan(Duration(milliseconds: 760)),
TestSpan(Duration(milliseconds: 140)),
TestSpan(Duration(milliseconds: 100)),
TestSpan(Duration(milliseconds: 800)),
TestSpan(Duration(milliseconds: 160)),
TestSpan(Duration(milliseconds: 80)),
]);
seq.playhead = Duration(milliseconds: 800);
expect(seq.currentIndex, 1);
expect(seq.totalDuration, Duration(milliseconds: 1000));
expect(seq.totalDuration, Duration(milliseconds: 1040));
seq[0] = TestSpan(Duration(seconds: 5));
expect(seq.currentIndex, 0);
expect(seq.playhead, Duration(milliseconds: 800));
Expand Down

0 comments on commit 984ee36

Please sign in to comment.