buf2d/buffer_test.go

20 lines
299 B
Go
Raw Normal View History

2020-10-01 13:14:36 +02:00
package buf2d
import (
"fmt"
2020-10-01 13:37:58 +02:00
"strings"
2020-10-01 13:14:36 +02:00
"testing"
)
func TestSub(t *testing.T) {
b := NewBuffer(10, 10)
s := b.Sub(1, 1, b.Width()-1, b.Height()-1)
2020-10-01 13:37:58 +02:00
b.Set(5, 1, 'a')
2020-10-01 13:14:36 +02:00
s.Set(5, 5, 'b')
2020-10-01 13:56:05 +02:00
b.WriteString("Hello world", 1, 2)
2020-10-01 13:14:36 +02:00
fmt.Println(b)
2020-10-01 13:37:58 +02:00
fmt.Println(strings.Repeat("-", 20))
2020-10-01 13:14:36 +02:00
fmt.Println(s)
}