forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base32_unittest.cc
38 lines (32 loc) · 871 Bytes
/
base32_unittest.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/base32.h"
#include "gtest/gtest.h"
TEST(Base32Test, CanEncode) {
{
auto result = fml::Base32Encode("hello");
ASSERT_TRUE(result.first);
ASSERT_EQ(result.second, "NBSWY3DP");
}
{
auto result = fml::Base32Encode("helLo");
ASSERT_TRUE(result.first);
ASSERT_EQ(result.second, "NBSWYTDP");
}
{
auto result = fml::Base32Encode("");
ASSERT_TRUE(result.first);
ASSERT_EQ(result.second, "");
}
{
auto result = fml::Base32Encode("1");
ASSERT_TRUE(result.first);
ASSERT_EQ(result.second, "GE");
}
{
auto result = fml::Base32Encode("helLo");
ASSERT_TRUE(result.first);
ASSERT_EQ(result.second, "NBSWYTDP");
}
}