Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Use skip instead of a non-standard test function
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 337948621
  • Loading branch information
kevmoo committed Oct 20, 2020
1 parent 3fe3a90 commit 0172d85
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions test/message_format_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// Tests for the MessageFormat class.
///
/// Currently, these tests are the ones directly ported from Closure.
// Tests for the MessageFormat class.
//
// Currently, these tests are the ones directly ported from Closure.

import 'package:intl/message_format.dart';
import 'package:test/test.dart';
Expand Down Expand Up @@ -375,7 +375,7 @@ void main() {
expect(fmt.format({'NUM_FLOOR': 25}), 'Other 23');
});

ignoreTest('testSimpleOrdinal', () {
test('testSimpleOrdinal', () {
// TOFIX. Ordinal not supported in Dart
var fmt = MessageFormat('{NUM_FLOOR, selectordinal, '
'one {Take the elevator to the #st floor.}'
Expand All @@ -391,9 +391,9 @@ void main() {
fmt.format({'NUM_FLOOR': 23}), 'Take the elevator to the 23rd floor.');
// Esoteric example.
expect(fmt.format({'NUM_FLOOR': 0}), 'Take the elevator to the 0th floor.');
});
}, skip: 'Ordinal not supported in Dart');

ignoreTest('testOrdinalWithNegativeValue', () {
test('testOrdinalWithNegativeValue', () {
// TOFIX. Ordinal not supported in Dart
var fmt = MessageFormat('{NUM_FLOOR, selectordinal, '
'one {Take the elevator to the #st floor.}'
Expand All @@ -409,9 +409,9 @@ void main() {
fmt.format({'NUM_FLOOR': -3}), 'Take the elevator to the -3rd floor.');
expect(
fmt.format({'NUM_FLOOR': -4}), 'Take the elevator to the -4th floor.');
});
}, skip: 'Ordinal not supported in Dart');

ignoreTest('testSimpleOrdinalWithIgnorePound', () {
test('testSimpleOrdinalWithIgnorePound', () {
// TOFIX. Ordinal not supported in Dart
var fmt = MessageFormat('{NUM_FLOOR, selectordinal, '
'one {Take the elevator to the #st floor.}'
Expand All @@ -423,7 +423,7 @@ void main() {
'Take the elevator to the #th floor.');
});

ignoreTest('testMissingOrInvalidOrdinalParameter', () {
test('testMissingOrInvalidOrdinalParameter', () {
// TOFIX. Ordinal not supported in Dart
var fmt = MessageFormat('{SOME_NUM, selectordinal, other {result}}');

Expand All @@ -434,11 +434,5 @@ void main() {
// Value is not a number.
expect(fmt.format({'SOME_NUM': 'Value'}),
'Undefined or invalid parameter - SOME_NUM');
});
}, skip: 'Ordinal not supported in Dart');
} // end of main

// Disabling unit tests without having to comment the whole body.
// Similar to @Ignore in JUnit
void ignoreTest(description, body) {
print('\u001b[93mTest ignored: $description\u001b[m');
}

0 comments on commit 0172d85

Please sign in to comment.