mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
23 lines
537 B
Go
23 lines
537 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package publiccontent
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
func TestLoadMetadataReadsTitleAndBody(t *testing.T) {
|
|
path := filepath.Join(t.TempDir(), "metadata.json")
|
|
writeFile(t, path, `{"title":"public change","body":"pass`+`word = \"example-password\""}`)
|
|
|
|
got, err := LoadMetadata(path)
|
|
if err != nil {
|
|
t.Fatalf("LoadMetadata() error = %v", err)
|
|
}
|
|
if got.Title != "public change" || got.Body == "" {
|
|
t.Fatalf("metadata = %#v", got)
|
|
}
|
|
}
|