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

shader
test ()
{
    // float
    {
        printf ("float:\n");
        float a = 0.7;
        float b = 0.2;
        printf ("  %g == %g = %d\n", a, b, a==b);
        printf ("  %g != %g = %d\n", a, b, a!=b);
        printf ("  %g < %g = %d\n", a, b, a<b);
        printf ("  %g <= %g = %d\n", a, b, a<=b);
        printf ("  %g > %g = %d\n", a, b, a>b);
        printf ("  %g >= %g = %d\n", a, b, a>=b);
    }

    // int
    {
        printf ("int:\n");
        int a = 7;
        int b = 2;
        printf ("  %d == %d = %d\n", a, b, a==b);
        printf ("  %d != %d = %d\n", a, b, a!=b);
        printf ("  %d < %d = %d\n", a, b, a<b);
        printf ("  %d <= %d = %d\n", a, b, a<=b);
        printf ("  %d > %d = %d\n", a, b, a>b);
        printf ("  %d >= %d = %d\n", a, b, a>=b);
    }

    // triple
    {
        printf ("triple:\n");
        color a = 0.7;
        color b = 0.2;
        color c = 0.7;
        float f = 0.2;
        printf ("  %g == %g = %d\n", a, b, a==b);
        printf ("  %g == %g = %d\n", a, c, a==c);
        printf ("  %g == %g = %d\n", a, f, a==f);
        printf ("  %g == %g = %d\n", b, f, b==f);
        printf ("  %g != %g = %d\n", a, b, a!=b);
        printf ("  %g != %g = %d\n", a, c, a!=c);
        printf ("  %g != %g = %d\n", a, f, a!=f);
        printf ("  %g != %g = %d\n", b, f, b!=f);

    }

    // matrix
    {
        printf ("matrix:\n");
        matrix a = 1;
        matrix b = 0.2;
        float f = 1;
        printf ("  %g == %g = %d\n", a, b, a==b);
        printf ("  %g == %g = %d\n", a, f, a==f);
        printf ("  %g == %g = %d\n", b, f, b==f);
        printf ("  %g != %g = %d\n", a, b, a!=b);
        printf ("  %g != %g = %d\n", a, f, a!=f);
        printf ("  %g != %g = %d\n", b, f, b!=f);
    }

    // string
    {
        printf ("string:\n");
        string a = "hi";
        string b = "there";
        string c = "hi";
        printf ("  \"%s\" == \"%s\" = %d\n", a, b, a==b);
        printf ("  \"%s\" != \"%s\" = %d\n", a, b, a!=b);
        printf ("  \"%s\" == \"%s\" = %d\n", a, c, a==c);
        printf ("  \"%s\" != \"%s\" = %d\n", a, c, a!=c);
    }
}
