(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestRunTableCreate_PipeTable(t *testing.T) { |
| 95 | doc := buildDoc(para(plain("PLACEHOLDER"))) |
| 96 | svc, cleanup := newSedTestServer(t, doc) |
| 97 | defer cleanup() |
| 98 | ctx := mockDocsContext(t, svc) |
| 99 | |
| 100 | cmd := &DocsSedCmd{} |
| 101 | u := sedTestUI() |
| 102 | pipeExpr := "|Name|Age|\n|Alice|30|" |
| 103 | expr := sedExpr{pattern: "PLACEHOLDER", replacement: pipeExpr} |
| 104 | spec := parseTableFromPipes(pipeExpr) |
| 105 | require.NotNil(t, spec) |
| 106 | err := cmd.runTableCreate(ctx, u, "", "test-doc-id", expr, spec) |
| 107 | assert.NoError(t, err) |
| 108 | } |
| 109 | |
| 110 | func TestRunTableCreate_NoMatch(t *testing.T) { |
| 111 | doc := buildDoc(para(plain("no match here"))) |
nothing calls this directly
no test coverage detected