Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[video_player] Use epislon to compare values in matrix in test #6088

Merged
merged 3 commits into from
Jul 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use epislon to compare values in matrix in test
  • Loading branch information
Chris Yang committed Jul 8, 2022
commit 7bde751d33af5e2f427307312197d34cbd87c2a3
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:math' as math;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -160,8 +161,12 @@ void main() {
await tester.pumpWidget(VideoPlayer(controller));
final Transform actualRotationCorrection =
find.byType(Transform).evaluate().single.widget as Transform;
expect(
actualRotationCorrection.transform, equals(Matrix4.rotationZ(math.pi)));
final Float64List actualRotationCorrectionStorage = actualRotationCorrection.transform.storage;
final Float64List expectedMatrixStorage = Matrix4.rotationZ(math.pi).storage;
expect(actualRotationCorrectionStorage.length, equals(expectedMatrixStorage.length));
for (int i = 0; i < actualRotationCorrectionStorage.length; i ++) {
expect(actualRotationCorrectionStorage[i], moreOrLessEquals(expectedMatrixStorage[i]));
}
});

testWidgets('no transform when rotationCorrection is zero',
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy