2018-11-08 12:58:43 -05:00
|
|
|
// Based on https://github.com/golang/go/blob/891682/src/net/textproto/
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2019-05-01 12:13:23 -04:00
|
|
|
import { append } from "./mod.ts";
|
|
|
|
import { assertEquals } from "../testing/asserts.ts";
|
2019-03-06 16:39:50 -05:00
|
|
|
import { test } from "../testing/mod.ts";
|
2019-05-01 12:13:23 -04:00
|
|
|
import "./reader_test.ts";
|
2018-12-17 23:14:22 -05:00
|
|
|
|
2019-04-24 07:41:23 -04:00
|
|
|
test(async function textprotoAppend(): Promise<void> {
|
2018-12-17 23:14:22 -05:00
|
|
|
const enc = new TextEncoder();
|
|
|
|
const dec = new TextDecoder();
|
|
|
|
const u1 = enc.encode("Hello ");
|
|
|
|
const u2 = enc.encode("World");
|
|
|
|
const joined = append(u1, u2);
|
2019-03-06 19:42:24 -05:00
|
|
|
assertEquals(dec.decode(joined), "Hello World");
|
2018-12-17 23:14:22 -05:00
|
|
|
});
|