package report
import (
"bytes"
"fmt"
"html"
"os"
"regexp"
"strconv"
"strings"
"testing"
b "bakeoff/harness"
)
func fixture() []b.AppResult {
live := b.AppResult{
Slug: "go", Language: "Go", Status: "LIVE", URL: "https://todo-go.bfj.oncarlos.com", Version: "abc1234",
Stack: "net/http, html/template, modernc.org/sqlite",
BehaviourJSOn: b.Behaviour{Passed: 35}, BehaviourJSOff: b.Behaviour{Passed: 33, Skipped: 2},
TTFBEmpty: b.Stats{N: 30, P50: 41.2}, TTFB50: b.Stats{N: 30, P50: 45.9},
Wake: []float64{120, 140, 130},
Load: []b.LoadResult{{Scenario: "read", Concurrency: 1, RPS: 20, Status: map[string]int{"200": 1}}, {Scenario: "read", Concurrency: 2, RPS: 40, Status: map[string]int{"200": 1}},
{Scenario: "read", Concurrency: 4, RPS: 41, Status: map[string]int{"200": 1}}, {Scenario: "toggle", Concurrency: 1, RPS: 15, Status: map[string]int{"200": 1}},
{Scenario: "toggle", Concurrency: 2, RPS: 30, Status: map[string]int{"200": 1}}, {Scenario: "toggle", Concurrency: 4, RPS: 31, ErrorRate: 0.4, Status: map[string]int{"303": 6, "503": 4}},
{Scenario: "read-after", Concurrency: 1, RPS: 20, Status: map[string]int{"200": 1}}, {Scenario: "read-after", Concurrency: 2, RPS: 9, ErrorRate: 0.5, Status: map[string]int{"200": 5, "502": 5}}},
Weight: b.Weight{HTMLBytes: 9000, JSBytes: 2400},
Code: b.CodeStats{Server: 300, Templates: 80, JS: 120, Tests: 200, Deps: 1},
Build: b.Build{ColdSeconds: 1097.4, WarmSeconds: 2, EditSeconds: 1.1, Bytes: 9_400_000, Host: "docs-t1"},
TokensBuild: b.Tokens{Output: 50000, CostUSD: 4.2, Seconds: 1800}, TokensFix: b.Tokens{Output: 5000, CostUSD: 0.5},
Readability: b.Readability{Overall: 8, Naming: 4, Structure: 4, Traceability: 5, Errors: 4, Comments: 3, Notes: "Clear & tidy