blob: 9b8fb0944eb7b2e4f234efb98dea2493e5e17395 [file] [log] [blame]
// 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.
/// @assertion T encode(S input)
/// @description Checks that this method encodes strings to ASCII code units
/// @author
import "dart:convert";
import "../../../Utils/expect.dart";
main() {
AsciiCodec codec = new AsciiCodec();
for (int i = 0; i < 128; i++) {
String s = new String.fromCharCode(i);
Expect.listEquals([i], codec.encode(s));
Expect.listEquals([], codec.encode(""));