summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-04-23 09:27:15 -0700
committerVicent Marti <vicent@github.com>2014-04-23 09:27:15 -0700
commit212b6205d70ff7c0f0f0b1eda6ac964c8d09d431 (patch)
tree9f0215a2324dd26f6e9545c73269cbe9722cab4e /tests/core
parent5ca410b9a9bc30a65ed0125646b3702d5943100b (diff)
parente349ed500b75349b1a525fce60dc08c8d8927ba0 (diff)
downloadlibgit2-212b6205d70ff7c0f0f0b1eda6ac964c8d09d431.tar.gz
Merge pull request #2291 from ethomson/patch_binary
patch: emit deflated binary patches (optionally)
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/buffer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/core/buffer.c b/tests/core/buffer.c
index eb1d95a95..da5ec605c 100644
--- a/tests/core/buffer.c
+++ b/tests/core/buffer.c
@@ -773,6 +773,26 @@ void test_core_buffer__base64(void)
git_buf_free(&buf);
}
+void test_core_buffer__base85(void)
+{
+ git_buf buf = GIT_BUF_INIT;
+
+ cl_git_pass(git_buf_put_base85(&buf, "this", 4));
+ cl_assert_equal_s("bZBXF", buf.ptr);
+ git_buf_clear(&buf);
+
+ cl_git_pass(git_buf_put_base85(&buf, "two rnds", 8));
+ cl_assert_equal_s("ba!tca&BaE", buf.ptr);
+ git_buf_clear(&buf);
+
+ cl_git_pass(git_buf_put_base85(&buf, "this is base 85 encoded",
+ strlen("this is base 85 encoded")));
+ cl_assert_equal_s("bZBXFAZc?TVqtS-AUHK3Wo~0{WMyOk", buf.ptr);
+ git_buf_clear(&buf);
+
+ git_buf_free(&buf);
+}
+
void test_core_buffer__classify_with_utf8(void)
{
char *data0 = "Simple text\n";