b31d8d0096
- Added migration to harden task audit tracking by modifying audit_logs and related tables. - Introduced operator_id to several tables for better tracking of actions. - Updated article_templates with new prompt templates for various article types, enhancing content generation. - Created prompt_rules and schedule_tasks tables to manage content generation rules and scheduling. - Added foreign key constraints to articles for better data integrity.
24 lines
632 B
Go
24 lines
632 B
Go
package app
|
|
|
|
import "testing"
|
|
|
|
func TestEstimateWordCountCountsChineseContent(t *testing.T) {
|
|
input := "# 海翔家居评测\n这是一段中文内容,用来验证生成文章的字数统计。"
|
|
|
|
got := estimateWordCount(input)
|
|
want := countArticleWords(input)
|
|
if got != want {
|
|
t.Fatalf("estimateWordCount() = %d, want %d", got, want)
|
|
}
|
|
}
|
|
|
|
func TestEstimateWordCountCountsMixedContent(t *testing.T) {
|
|
input := "2026 海翔家居 review,适合 small apartment 用户。"
|
|
|
|
got := estimateWordCount(input)
|
|
want := countArticleWords(input)
|
|
if got != want {
|
|
t.Fatalf("estimateWordCount() = %d, want %d", got, want)
|
|
}
|
|
}
|