napi-rs/examples/napi-compat-mode/__tests__/string.spec.ts
forehal a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00

22 lines
609 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 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())
})