// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

#include "../common/shaders/pretty.h"


shader
test ()
{
    {
        float a = 0.1, b = 0.2, c = 0.5;
        printf ("  point (%g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(point(a,b,c)));
        printf ("  vector (%g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(vector(a,b,c)));
        printf ("  normal (%g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(normal(a,b,c)));
    }

    {
        float a = 1, b = 1, c = 0;
        printf ("\ntesting with spaces:\n");
        printf ("  point (\"shader\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(point("shader",a,b,c)));
        printf ("  vector (\"shader\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(vector("shader",a,b,c)));
        printf ("  normal (\"shader\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(normal("shader",a,b,c)));
        printf ("  point (\"object\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(point("object",a,b,c)));
        printf ("  vector (\"object\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(vector("object",a,b,c)));
        printf ("  normal (\"object\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(normal("object",a,b,c)));
        printf ("  point (\"myspace\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(point("myspace",a,b,c)));
        printf ("  vector (\"myspace\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(vector("myspace",a,b,c)));
        printf ("  normal (\"myspace\", %g, %g, %g) = %g\n",
                pretty(a), pretty(b), pretty(c), pretty(normal("myspace",a,b,c)));
    }
}
