# Path: gridded/pyugrid/util.py
# def point_in_tri(face_points, point, return_weights=False):
# def _signed_area_tri(points):
# def isarraylike(obj):
# def asarraylike(obj):


import numpy as np
from gridded.pyugrid import util
    print(dum)
    print(dum.dtype)
    for attr in DummyArrayLike.must_have:
        assert hasattr(dum, attr)


def test_asarraylike_list():
    """
    Passing in a list should return a np.ndarray.

    """
    lst = [1, 2, 3, 4]
    result = util.asarraylike(lst)
    assert isinstance(result, np.ndarray)
    assert np.array_equal(result, lst)


def test_asarraylike_array():
    """
    Passing in a list should return a np.ndarray.

    """
    arr = np.array([1, 2, 3, 4])
    result = util.asarraylike(arr)

    assert result is arr


def test_as_test_asarraylike_dummy():
    dum = DummyArrayLike()

# Path: gridded/pyugrid/util.py
# def point_in_tri(face_points, point, return_weights=False):
# def _signed_area_tri(points):
# def isarraylike(obj):
# def asarraylike(obj):


# Path: gridded/tests/test_ugrid/test_util.py
import numpy as np
from gridded.pyugrid import util

    print(dum)
    print(dum.dtype)
    for attr in DummyArrayLike.must_have:
        assert hasattr(dum, attr)


def test_asarraylike_list():
    """
    Passing in a list should return a np.ndarray.

    """
    lst = [1, 2, 3, 4]
    result = util.asarraylike(lst)
    assert isinstance(result, np.ndarray)
    assert np.array_equal(result, lst)


def test_asarraylike_array():
    """
    Passing in a list should return a np.ndarray.

    """
    arr = np.array([1, 2, 3, 4])
    result = util.asarraylike(arr)

    assert result is arr


def test_as_test_asarraylike_dummy():
    dum = DummyArrayLike()

    result = util.asarraylike(dum)