enso/app/gui2/shared/__tests__/ensoFile.test.ts
Paweł Grabarz 48a5599eb6
improve argument placeholder resolution for partial applications and … (#8794)
Fixes #8788

- Fixed missing argument lists on constructors, and improved handling for various cases of partially applied functions.
- Extended tests to check for correct `self` argument placeholders.
- Additionally reworked some questionable test code to maintain separation between server and client code.

<img width="1241" alt="image" src="https://github.com/enso-org/enso/assets/919491/5377f57f-18f0-4a50-a8ab-9331862ca547">
2024-01-18 13:13:31 +00:00

29 lines
455 B
TypeScript

import { combineFileParts, splitFileContents } from 'shared/ensoFile'
import { expect, test } from 'vitest'
const cases = [
`foo`,
`foo
#### METADATA ####
[]
{}`,
`a "#### METADATA ####"`,
`a
#### METADATA ####
#### METADATA ####
[]
{}`,
]
test.each(cases)('File split and combine roundtrip $#', (contents) => {
const parts = splitFileContents(contents)
const combined = combineFileParts(parts)
expect(combined).toEqual(contents)
})