| Index: sdk/lib/_internal/pub_generated/test/utils_test.dart
|
| diff --git a/sdk/lib/_internal/pub_generated/test/utils_test.dart b/sdk/lib/_internal/pub_generated/test/utils_test.dart
|
| index 3d467114309b284606f7ea15f13d847826d71f72..178b7f753881bd06ae5a41c6d4347e3ee7831393 100644
|
| --- a/sdk/lib/_internal/pub_generated/test/utils_test.dart
|
| +++ b/sdk/lib/_internal/pub_generated/test/utils_test.dart
|
| @@ -1,23 +1,33 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// 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.
|
| +
|
| library utils_test;
|
| +
|
| import 'package:unittest/unittest.dart';
|
| import 'test_pub.dart';
|
| import '../lib/src/utils.dart';
|
| +
|
| main() {
|
| initConfig();
|
| +
|
| group('yamlToString()', () {
|
| test('null', () {
|
| expect(yamlToString(null), equals('null'));
|
| });
|
| +
|
| test('numbers', () {
|
| expect(yamlToString(123), equals('123'));
|
| expect(yamlToString(12.34), equals('12.34'));
|
| });
|
| +
|
| test('does not quote strings that do not need it', () {
|
| expect(yamlToString('a'), equals('a'));
|
| expect(yamlToString('some-string'), equals('some-string'));
|
| expect(yamlToString('hey123CAPS'), equals('hey123CAPS'));
|
| expect(yamlToString("_under_score"), equals('_under_score'));
|
| });
|
| +
|
| test('quotes other strings', () {
|
| expect(yamlToString(''), equals('""'));
|
| expect(yamlToString('123'), equals('"123"'));
|
| @@ -27,9 +37,11 @@ main() {
|
| expect(yamlToString("new\nline"), equals(r'"new\nline"'));
|
| expect(yamlToString("?unctu@t!on"), equals(r'"?unctu@t!on"'));
|
| });
|
| +
|
| test('lists use JSON style', () {
|
| expect(yamlToString([1, 2, 3]), equals('[1,2,3]'));
|
| });
|
| +
|
| test('uses indentation for maps', () {
|
| expect(yamlToString({
|
| 'a': {
|
| @@ -43,6 +55,7 @@ a:
|
| c: 2
|
| d: 3"""));
|
| });
|
| +
|
| test('sorts map keys', () {
|
| expect(yamlToString({
|
| 'a': 1,
|
| @@ -55,6 +68,7 @@ b: 3
|
| c: 2
|
| d: 4"""));
|
| });
|
| +
|
| test('quotes map keys as needed', () {
|
| expect(yamlToString({
|
| 'no': 1,
|
| @@ -65,16 +79,19 @@ d: 4"""));
|
| no: 1
|
| "yes!": 2"""));
|
| });
|
| +
|
| test('handles non-string map keys', () {
|
| var map = new Map();
|
| map[null] = "null";
|
| map[123] = "num";
|
| map[true] = "bool";
|
| +
|
| expect(yamlToString(map), equals("""
|
| 123: num
|
| null: null
|
| true: bool"""));
|
| });
|
| +
|
| test('handles empty maps', () {
|
| expect(yamlToString({}), equals("{}"));
|
| expect(yamlToString({
|
|
|