blob: 53ed5bcd376f8b1fc9704a2ffb145c8db0418b1a [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 List<int> convert(
/// String input, [
/// int start = 0,
/// int end
/// ])
/// Converts input and returns the result of the conversion.
/// @description Checks that this method decodes data to base54 code units
/// @author sgrekhov@unipro.ru
import "dart:convert";
import "../../../Utils/expect.dart";
main() {
Base64Decoder decoder = new Base64Decoder();
for (int i = 0; i < 256; i++) {
String encoded = base64.encode([i]);
Expect.listEquals([i], decoder.convert(encoded));
}
String encoded = "U29tZSBzdHJpbmc=";
Expect.listEquals("Some string".codeUnits, decoder.convert(encoded));
}