package lua

import (
	"regexp"
	"testing"
)

// https://github.com/Shopify/go-lua/pull/63
func TestPushFStringPointer(t *testing.T) {
	l := NewState()
	l.PushFString("%p %s", l, "test")

	actual := CheckString(l, -1)
	ok, err := regexp.MatchString("0x[0-9a-f]+ test", actual)
	if !ok {
		t.Error("regex did not match")
	} else if err != nil {
		t.Errorf("regex error: %s", err.Error())
	}
}

package lua

import (
	"fmt"
	"testing"
)

func TestPushFStringPointer(t *testing.T) {
	l := NewState()
	l.PushFString("%p %s", l, "test")

	expected := fmt.Sprintf("%p %s", l, "test")
	actual := CheckString(l, -1)
	if expected != actual {
		t.Errorf("PushFString, expected \"%s\" but found \"%s\"", expected, actual)
	}
}

Use exact string match for PushFString test.
Use exact string match for PushFString test.
