a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
30 lines
909 B
Go
30 lines
909 B
Go
package graph
|
|
|
|
import "testing"
|
|
|
|
func TestOriginRank_Speculative(t *testing.T) {
|
|
if OriginRank(OriginSpeculative) >= OriginRank(OriginTextMatched) {
|
|
t.Errorf("speculative (%d) must rank below text_matched (%d)",
|
|
OriginRank(OriginSpeculative), OriginRank(OriginTextMatched))
|
|
}
|
|
if OriginRank(OriginSpeculative) <= OriginRank("") {
|
|
t.Errorf("speculative must rank above unknown/empty")
|
|
}
|
|
if MeetsMinTier(OriginSpeculative, OriginTextMatched) {
|
|
t.Errorf("min_tier=text_matched must exclude speculative edges")
|
|
}
|
|
if !MeetsMinTier(OriginSpeculative, "") {
|
|
t.Errorf("empty min_tier must pass speculative edges")
|
|
}
|
|
}
|
|
|
|
func TestEdge_IsSpeculative(t *testing.T) {
|
|
if (&Edge{}).IsSpeculative() {
|
|
t.Errorf("plain edge must not be speculative")
|
|
}
|
|
e := &Edge{Meta: map[string]any{MetaSpeculative: true}}
|
|
if !e.IsSpeculative() {
|
|
t.Errorf("edge with MetaSpeculative=true must be speculative")
|
|
}
|
|
}
|