Search Apps Documentation Source Content File Folder Download Copy Actions Download

params_test.gno

1.02 Kb · 38 lines
 1package params
 2
 3import (
 4	"testing"
 5)
 6
 7// Testing this package is limited because it only contains an `std.Set` method
 8// without a corresponding `std.Get` method. For comprehensive testing, refer to
 9// the tests located in the r/gov/dao/ directory, specifically in one of the
10// propX_filetest.gno files.
11
12func TestNewStringPropRequest(cur realm, t *testing.T) {
13	pr := NewSysParamStringPropRequest(cur, "foo", "bar", "baz", "qux")
14	if pr.Title() == "" {
15		t.Errorf("executor shouldn't be nil")
16	}
17}
18
19func TestNewSetHaltRequest(cur realm, t *testing.T) {
20	pr := NewSetHaltRequest(cur, 100_000, "chain/gnoland1.1")
21	if pr.Title() == "" {
22		t.Errorf("proposal title shouldn't be empty")
23	}
24}
25
26func TestNewSetHaltRequestNoVersion(cur realm, t *testing.T) {
27	pr := NewSetHaltRequest(cur, 100_000, "")
28	if pr.Title() == "" {
29		t.Errorf("proposal title shouldn't be empty")
30	}
31}
32
33func TestNewSetHaltRequestCancel(cur realm, t *testing.T) {
34	pr := NewSetHaltRequest(cur, 0, "")
35	if pr.Title() == "" {
36		t.Errorf("proposal title shouldn't be empty")
37	}
38}