github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/demo/art/millipede/millipede_test.gno (about)

     1  package millipede
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestRender(t *testing.T) {
     9  	cases := []struct {
    10  		path     string
    11  		expected string
    12  	}{
    13  		{
    14  			path: "",
    15  			expected: "```" + `
    16      ╚⊙ ⊙╝
    17    ╚═(███)═╝
    18   ╚═(███)═╝
    19  ╚═(███)═╝
    20   ╚═(███)═╝
    21    ╚═(███)═╝
    22     ╚═(███)═╝
    23      ╚═(███)═╝
    24      ╚═(███)═╝
    25     ╚═(███)═╝
    26    ╚═(███)═╝
    27   ╚═(███)═╝
    28  ╚═(███)═╝
    29   ╚═(███)═╝
    30    ╚═(███)═╝
    31     ╚═(███)═╝
    32      ╚═(███)═╝
    33      ╚═(███)═╝
    34     ╚═(███)═╝
    35    ╚═(███)═╝
    36   ╚═(███)═╝
    37  ` + "```\n[19](/r/art/millpede:19)<  >[21](/r/art/millipede:21)",
    38  		},
    39  		{
    40  			path: "4",
    41  			expected: "```" + `
    42      ╚⊙ ⊙╝
    43    ╚═(███)═╝
    44   ╚═(███)═╝
    45  ╚═(███)═╝
    46   ╚═(███)═╝
    47  ` + "```\n[3](/r/art/millpede:3)<  >[5](/r/art/millipede:5)",
    48  		},
    49  	}
    50  
    51  	for _, tc := range cases {
    52  		t.Run(tc.path, func(t *testing.T) {
    53  			got := Render(tc.path)
    54  			if got != tc.expected {
    55  				t.Errorf("expected %s, got %s.", tc.expected, got)
    56  			}
    57  		})
    58  	}
    59  }