初始化 ToolBox 开发者工具箱。
CI / docker (push) Successful in 11m42s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
renjue
2026-06-25 11:15:38 +08:00
commit f1502ed08c
66 changed files with 18020 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { describe, it, expect } from 'vitest'
import { countLines } from '../../src/composables/useLineNumberEditor.js'
describe('useLineNumberEditor.countLines', () => {
it('returns 1 for empty or whitespace-only text', () => {
expect(countLines('')).toBe(1)
expect(countLines(null)).toBe(1)
expect(countLines(undefined)).toBe(1)
})
it('counts single line without trailing newline', () => {
expect(countLines('hello')).toBe(1)
})
it('counts multiple lines', () => {
expect(countLines('a\nb\nc')).toBe(3)
expect(countLines('a\nb\n')).toBe(3)
})
})