- Add VariableSpec class with magnitude field validation - Add Formula class supporting multiple input/output variables - Support d4rt_code as string or object with code field - Add comprehensive tests for parsing and serialization - Fix broken test import in pruebas_d4rt_test.dart Follows README.md format requirements exactly
33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
// Copyright (c) 2017, 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.
|
|
|
|
import 'dart:math';
|
|
|
|
import 'package:io/ansi.dart';
|
|
|
|
/// Prints a sample of all of the `AnsiCode` values.
|
|
void main(List<String> args) {
|
|
final forScript = args.contains('--for-script');
|
|
|
|
if (!ansiOutputEnabled) {
|
|
print('`ansiOutputEnabled` is `false`.');
|
|
print("Don't expect pretty output.");
|
|
}
|
|
_preview('Foreground', foregroundColors, forScript);
|
|
_preview('Background', backgroundColors, forScript);
|
|
_preview('Styles', styles, forScript);
|
|
}
|
|
|
|
void _preview(String name, List<AnsiCode> values, bool forScript) {
|
|
print('');
|
|
final longest = values.map((ac) => ac.name.length).reduce(max);
|
|
|
|
print(wrapWith('** $name **', [styleBold, styleUnderlined]));
|
|
for (var code in values) {
|
|
final header =
|
|
'${code.name.padRight(longest)} ${code.code.toString().padLeft(3)}';
|
|
|
|
print("$header: ${code.wrap('Sample', forScript: forScript)}");
|
|
}
|
|
}
|