未验证 提交 3b6b8c40 编写于 作者: O openharmony_ci 提交者: Gitee

!9389 增加buffer模块from接口XTS

Merge pull request !9389 from 赵杜炜/master
...@@ -1912,6 +1912,18 @@ describe('BufferTest', function () { ...@@ -1912,6 +1912,18 @@ describe('BufferTest', function () {
expect(str).assertEqual("this is a test"); expect(str).assertEqual("this is a test");
}); });
/**
* @tc.name: testfrom0269
* @tc.desc: Create a new buffer containing a newline character string. Creating using base64 encoding
* For example: buffer.from(string, encoding);
*/
it("testfrom0269", 0, function () {
const str = `MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC/OgIQLaulKklB\npZltSaWwM3Cnzcmvh+LoqYFYjCePUxnoJRDusFqy4sjwBx9fn/XSxxJ9A0KxMtXa\nr7YFjwQo3FsIjLZ3+8wS+Kydcg==`;
const buf = buffer.from(str, 'base64');
let ref = buf.readInt8(buf.length - 1);
expect(ref).assertEqual(114);
});
/** /**
* @tc.name: testBlobConstructor0270 * @tc.name: testBlobConstructor0270
* @tc.desc: Creates a new Blob object containing a concatenation of the given sources. * @tc.desc: Creates a new Blob object containing a concatenation of the given sources.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册