ddat interop with dat js cable interop with cabal js ddat's frontend = dat-thang cable fe = cable-thang dillo support based on cel's dillo-dat bootstrap node xplatform support Signed-off-by: divo <418@cryspace.space>
16 lines
562 B
JavaScript
16 lines
562 B
JavaScript
'use strict'
|
|
|
|
const assert = require('assert')
|
|
const { quote, parse } = require('./cable_hyperswarm')
|
|
|
|
for (const value of [
|
|
'', 'plain text', 'quote " slash \\', 'line one\nline two',
|
|
'tabs\tand\bbackspace\f formfeed\r', 'Unicode: 媒腻㐤┖ꈳ埳 🐬'
|
|
]) {
|
|
assert.deepStrictEqual(parse('(send "general" ' + quote(value) + ')'), ['send', 'general', value])
|
|
}
|
|
|
|
assert.throws(() => parse('(send "unterminated)'), /unterminated/)
|
|
assert.throws(() => parse('(send "bad\\q")'), /unsupported S-expression escape/)
|
|
console.log('Cable S-expression IPC: PASS')
|