Download source/third_party/llama.cpp-1.0.0/tools/ui/tests/unit/markdown-syntax.test.ts from Yakimask/mimamo: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/tests/unit/markdown-syntax.test.ts
- Command line
-
hf download hf://Yakimask/mimamo/source/third_party/llama.cpp-1.0.0/tools/ui/tests/unit/markdown-syntax.test.ts
-
curl -L -o markdown-syntax.test.ts https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/tests/unit/markdown-syntax.test.ts
698 Bytes
| import { markdownLanguage } from '@codemirror/lang-markdown'; | |
| import { LanguageSupport } from '@codemirror/language'; | |
| import { EditorState } from '@codemirror/state'; | |
| import { codeRanges } from '$lib/components/app/content/MarkdownEditor/markdown-syntax'; | |
| import { describe, expect, it } from 'vitest'; | |
| function stateOf(doc: string): EditorState { | |
| return EditorState.create({ doc, extensions: new LanguageSupport(markdownLanguage) }); | |
| } | |
| describe('codeRanges', () => { | |
| it('lists inline code and code blocks in range', () => { | |
| const doc = 'a `b` c\n\n~~~\nd\n~~~'; | |
| const state = stateOf(doc); | |
| expect(codeRanges(state, 0, doc.length)).toEqual([ | |
| [2, 5], | |
| [9, doc.length] | |
| ]); | |
| }); | |
| }); | |