function assertEncodings(input, expectedOutputs) {
  const {text, binary} =
      typeof input === 'string' ? {text: input, binary: input} : input;
  const arr = crypt.stringToByteArray(binary);

  // quick validity test
  assertArrayEquals(arr, crypt.stringToUtf8ByteArray(text));

  // encodeString
  for (const name in base64.Alphabet) {
    const alphabet = base64.Alphabet[name];
    assertEquals(
        expectedOutputs[alphabet], base64.encodeStringUtf8(text, alphabet));
    assertEquals(expectedOutputs[alphabet], base64.encodeText(text, alphabet));
    assertEquals(
        expectedOutputs[alphabet], base64.encodeString(binary, alphabet));
    assertEquals(
        expectedOutputs[alphabet], base64.encodeBinaryString(binary, alphabet));
  }
  // default case
  assertEquals(
      expectedOutputs[base64.Alphabet.DEFAULT], base64.encodeText(text));
  assertEquals(
      expectedOutputs[base64.Alphabet.DEFAULT],
      base64.encodeBinaryString(binary));

  // encodeByteArray with Array<number>
  for (const name in base64.Alphabet) {
    const alphabet = base64.Alphabet[name];
    assertEquals(
        expectedOutputs[alphabet], base64.encodeByteArray(arr, alphabet));
  }
  // default case
  assertEquals(
      expectedOutputs[base64.Alphabet.DEFAULT], base64.encodeByteArray(arr));

  // encodeByteArray with Uint8Array
  if (SUPPORT_TYPED_ARRAY) {
    const uint8Arr = new Uint8Array(arr);
    for (const name in base64.Alphabet) {
      const alphabet = base64.Alphabet[name];
      assertEquals(
          expectedOutputs[alphabet],
          base64.encodeByteArray(uint8Arr, alphabet));
    }
    // default case
    assertEquals(
        expectedOutputs[base64.Alphabet.DEFAULT],
        base64.encodeByteArray(uint8Arr));
  }
}
Asserts encodings
@param {string|{binary: string, text: string}} input an input string.
@param {!Array<string>} expectedOutputs expected outputs in the order of
    base64.Alphabet enum.