Enable plain TTY logging mode + loose-data processing
This commit is contained in:
@@ -6892,7 +6892,7 @@ func TestBuildGeneratedApplyAfterPrunesLowLockedID(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildOverrideNullValueKeyNullifiesEntireRow(t *testing.T) {
|
||||
func TestBuildOverrideAsteriskKeyRemovesIdentityWithoutNullingRow(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data", "dense", "modules"))
|
||||
writeFile(t, filepath.Join(root, "topdata", "base_dialog.json"), "{}\n")
|
||||
@@ -6925,8 +6925,8 @@ func TestBuildOverrideNullValueKeyNullifiesEntireRow(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("read dense.2da: %v", err)
|
||||
}
|
||||
if !strings.Contains(string(got), "7\t****\t****\n") {
|
||||
t.Fatalf("expected override key \"****\" to nullify row 7, got:\n%s", string(got))
|
||||
if !strings.Contains(string(got), "7\tShouldNotLeak\tstill-not-kept\n") {
|
||||
t.Fatalf("expected override key \"****\" to remove identity without blanking row 7, got:\n%s", string(got))
|
||||
}
|
||||
lockRaw, err := os.ReadFile(filepath.Join(root, "topdata", "data", "dense", "lock.json"))
|
||||
if err != nil {
|
||||
@@ -11084,13 +11084,13 @@ func setTreeFileTimes(t *testing.T, root string, modTime time.Time) {
|
||||
if walkErr != nil {
|
||||
return walkErr
|
||||
}
|
||||
if d.IsDir() {
|
||||
return nil
|
||||
if err := os.Chtimes(path, modTime, modTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Chtimes(path, modTime, modTime)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("set file times under %s: %v", root, err)
|
||||
t.Fatalf("set tree times under %s: %v", root, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11302,6 +11302,34 @@ func TestValidateProjectWarnsWhenLockKeepsNormalizedEquivalentKeysAlive(t *testi
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildNativeSupportsLoosePlainTableAtTopdataDataRoot(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data"))
|
||||
writeFile(t, filepath.Join(root, "topdata", "base_dialog.json"), "{}\n")
|
||||
writeFile(t, filepath.Join(root, "topdata", "data", "ruleset.json"), `{
|
||||
"columns": ["Name", "Value"],
|
||||
"rows": [
|
||||
{"id": 0, "Name": "TEST_RULE", "Value": "1"}
|
||||
]
|
||||
}`+"\n")
|
||||
|
||||
proj := testProject(root)
|
||||
proj.Config.TopData.ReferenceBuilder = ""
|
||||
|
||||
report := ValidateProject(proj)
|
||||
if report.HasErrors() {
|
||||
t.Fatalf("expected loose root table to validate cleanly, got:\n%s", diagnosticsText(report.Diagnostics))
|
||||
}
|
||||
|
||||
result, err := BuildNativeWithOptions(proj, NativeBuildOptions{BuildWiki: false}, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("expected loose root table to build: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(result.Output2DADir, "ruleset.2da")); err != nil {
|
||||
t.Fatalf("expected ruleset.2da output for loose root table: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateProjectErrorsOnTopPackageAssetCollision(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))
|
||||
|
||||
Reference in New Issue
Block a user