package redis

import (
	"git.loafle.net/overflow/overflow_probe/discovery/core/scan/service/matcher/packet"
	"net"
	"testing"
)

func TestRedisProtected(t *testing.T) {

	m := NewRedisProtectedMatcher()

	conn, err := net.Dial("tcp", "192.168.1.215:8379")

	if err != nil {
		t.Log(err)
		return
	}

	defer conn.Close()

	bytes := make([]byte, 1024)
	n, _ := conn.Read(bytes)

	//fmt.Println(string(bytes[:n]))

	b := m.Match(0, packet.NewPacket(bytes, n), nil)

	if b {
		t.Log("good!")
	}

}
