func TestPropertyValue(t *testing.T) {
	t.Run("Value Undefined", func(t *testing.T) {
		require := require.New(t)
		p := NewProperty()
		require.Equal(Undefined, p.Value())
	})
	t.Run("Accessor Value Undefined", func(t *testing.T) {
		require := require.New(t)
		p := NewAccessorProperty(&Object{}, nil, True, False)
		require.Equal(Undefined, p.Value())
	})
	t.Run("Value Null", func(t *testing.T) {
		require := require.New(t)
		p := NewDataProperty(Null, False, False, False)
		require.Equal(Null, p.Value())
	})
	t.Run("Value", func(t *testing.T) {
		require := require.New(t)
		p := NewDataProperty(NewString("foobar"), False, False, False)
		require.Equal(NewString("foobar"), p.Value())
	})
}
TestPropertyValue ensures that a property's method
Value returns Undefined if the Value field is not set.
It also ensures that Null is returned if the Value is Null,
and that it returns a specific Value if it is set.
package lang
import (
	"testing"
	"github.com/stretchr/testify/require"
)
func TestNewProperty(t *testing.T) {
	require := require.New(t)
	p := NewProperty()
	require.Empty(p.Record.fields)
}
func TestNewPropertyBase(t *testing.T) {
	require := require.New(t)
	p := NewPropertyBase(False, True)
	require.Len(p.Record.fields, 2)
	field, ok := p.GetField(FieldNameEnumerable)
	require.True(ok)
	require.Equal(False, field)
	field, ok = p.GetField(FieldNameConfigurable)
	require.True(ok)
	require.Equal(True, field)
}
func TestNewDataProperty(t *testing.T) {
	require := require.New(t)
	p := NewDataProperty(NewString("foobar"), False, True, True)
	require.Len(p.Record.fields, 4)
	field, ok := p.GetField(FieldNameValue)
	require.True(ok)
	require.Equal(NewString("foobar"), field)
	field, ok = p.GetField(FieldNameWritable)
	require.True(ok)
	require.Equal(False, field)
	field, ok = p.GetField(FieldNameEnumerable)
	require.True(ok)
	require.Equal(True, field)
	field, ok = p.GetField(FieldNameConfigurable)
	require.True(ok)
	require.Equal(True, field)
}
func TestNewAccessorProperty(t *testing.T) {
	require := require.New(t)
	p := NewAccessorProperty(&Object{}, nil, True, False)
	require.Len(p.Record.fields, 4)
	field, ok := p.GetField(FieldNameGet)
	require.True(ok)
	require.NotNil(field)
	field, ok = p.GetField(FieldNameSet)
	require.True(ok)
	require.Nil(field)
	field, ok = p.GetField(FieldNameEnumerable)
	require.True(ok)
	require.Equal(True, field)
	field, ok = p.GetField(FieldNameConfigurable)
	require.True(ok)
	require.Equal(False, field)
}