61 lines
1.7 KiB
Go
61 lines
1.7 KiB
Go
package artifactmodel
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestRuntimeTranscriptArtifactsIncludesMarkdownOutputs(t *testing.T) {
|
|
want := []TranscriptArtifactSpec{
|
|
{
|
|
SourceID: SourceTranscriptBase,
|
|
CanonicalRelPath: TranscriptPathBase,
|
|
ProducerStage: "merge",
|
|
OutputKind: TranscriptOutputKindBase,
|
|
},
|
|
{
|
|
SourceID: SourceTranscriptPolished,
|
|
CanonicalRelPath: TranscriptPathPolished,
|
|
ProducerStage: "polish",
|
|
OutputKind: TranscriptOutputKindPolished,
|
|
},
|
|
{
|
|
SourceID: SourceTranscriptFinal,
|
|
CanonicalRelPath: TranscriptPathFinal,
|
|
ProducerStage: "normalize",
|
|
OutputKind: TranscriptOutputKindFinal,
|
|
},
|
|
{
|
|
SourceID: SourceTranscriptFinalTrimmed,
|
|
CanonicalRelPath: TranscriptPathFinalTrimmed,
|
|
ProducerStage: "trim",
|
|
OutputKind: TranscriptOutputKindFinalTrimmed,
|
|
},
|
|
{
|
|
SourceID: SourceTranscriptFinalMarkdown,
|
|
CanonicalRelPath: TranscriptPathFinalMarkdown,
|
|
ProducerStage: "render",
|
|
OutputKind: TranscriptOutputKindFinalMarkdown,
|
|
},
|
|
{
|
|
SourceID: SourceTranscriptFinalTrimmedMarkdown,
|
|
CanonicalRelPath: TranscriptPathFinalTrimmedMarkdown,
|
|
ProducerStage: "render",
|
|
OutputKind: TranscriptOutputKindFinalTrimmedMarkdown,
|
|
},
|
|
}
|
|
|
|
got := RuntimeTranscriptArtifacts()
|
|
if !reflect.DeepEqual(got, want) {
|
|
t.Fatalf("RuntimeTranscriptArtifacts() = %#v, want %#v", got, want)
|
|
}
|
|
}
|
|
|
|
func TestLookupRuntimeTranscriptArtifactFindsMarkdownOutputs(t *testing.T) {
|
|
for _, source := range []string{SourceTranscriptFinalMarkdown, SourceTranscriptFinalTrimmedMarkdown} {
|
|
if _, ok := LookupRuntimeTranscriptArtifact(source); !ok {
|
|
t.Fatalf("LookupRuntimeTranscriptArtifact(%q) ok=false, want true", source)
|
|
}
|
|
}
|
|
}
|