-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
This unit test for extension methods relies on the string representation of numbers which varies slightly on our web platforms where we fall back to how the numbers are represented in javascript.
co19/LanguageFeatures/Extension-methods/call_member_t02.dart
Lines 33 to 36 in 50c5e29
Expect.equals("My name is int(10)", 1(10)); | |
Expect.equals("My name is int(10.0)", 1(10.0)); | |
Expect.equals("My name is num(10)", 1.0(10)); | |
Expect.equals("My name is num(10.0)", 1.0(10.0)); |
In this case floating point numbers that represent integral values are printed without a decimal and are causing the test to fail even though the extension method feature is working. Could the test be rewritten to avoid this?
On the DartVM:
num n = 10.0;
print(n); // prints 10.0
On web platforms:
num n = 10.0;
print(n); // prints 10
Metadata
Metadata
Assignees
Labels
No labels