mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
* fix(napi): JsString should respect \0 character to align with String * chore(test): update snapshot
29 lines
796 B
TypeScript
29 lines
796 B
TypeScript
import test from 'ava'
|
|
|
|
const bindings = require('../index.node')
|
|
|
|
test('should be able to concat string', (t) => {
|
|
const fixture = 'JavaScript 🌳 你好 napi'
|
|
t.snapshot(bindings.concatString(fixture))
|
|
})
|
|
|
|
test('should be able to concat string with char \0', (t) => {
|
|
const fixture = 'JavaScript \0 🌳 你好 \0 napi'
|
|
t.snapshot(fixture)
|
|
t.snapshot(bindings.concatString(fixture))
|
|
})
|
|
|
|
test('should be able to concat utf16 string', (t) => {
|
|
const fixture = 'JavaScript 🌳 你好 napi'
|
|
t.snapshot(bindings.concatUTF16String(fixture))
|
|
})
|
|
|
|
test('should be able to concat latin1 string', (t) => {
|
|
const fixture = 'æ¶½¾DEL'
|
|
t.snapshot(bindings.concatLatin1String(fixture))
|
|
})
|
|
|
|
test('should be able to crate latin1 string', (t) => {
|
|
t.snapshot(bindings.createLatin1())
|
|
})
|