Skip to content

Conversation

@marcelo8690
Copy link
Contributor

fix compare Guid Not Equals

fix compare Guid Not Equals
@xoofx
Copy link
Member

xoofx commented Oct 26, 2025

Could you add a small test?

@xoofx xoofx added the bug label Oct 26, 2025
@marcelo8690
Copy link
Contributor Author

try this

using System;
using Scriban;

class Program
{
static void Main()
{
// Guids de ejemplo
Guid id1 = Guid.NewGuid();
Guid id2 = Guid.NewGuid();

    // Template HTML con la comparación en Scriban
    var templateText = @"

{{if guid1!=guid2}}
OK!
{{ end }}

guid1={{ guid1 }}

guid2={{ guid2 }}
";

    var template = Template.Parse(templateText);

    var model = new
    {
        guid1 = id1,
        guid2 = id2
    };

    string html = template.Render(model, memberRenamer: member => member.Name);

    Console.WriteLine(html);
}

}

@marcelo8690
Copy link
Contributor Author

It failed when I wanted to compare if two Guids were different.
With the change it fixed

@xoofx
Copy link
Member

xoofx commented Oct 26, 2025

With the change it fixed

I understand the fix but I'm asking you to add a unit test to this PR. 🙂

add compare diferents Guids
@marcelo8690
Copy link
Contributor Author

Ready, I've already added the unit testing

@xoofx xoofx merged commit 7e4d2ee into scriban:master Oct 27, 2025
1 check passed
@xoofx
Copy link
Member

xoofx commented Oct 27, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants