// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.

// t_strings_test.go
package expr

import (
	"testing"

	"git.portale-stac.it/go-pkg/expr/types/array"
)

func TestStringsParser(t *testing.T) {
	section := "String"
	inputs := []inputType{
		/*  1 */ {`"uno" + "due"`, `unodue`, nil},
		/*  2 */ {`"uno" + 2`, `uno2`, nil},
		/*  3 */ {`"uno" + (2+1)`, `uno3`, nil},
		/*  4 */ {`"uno" * (2+1)`, `unounouno`, nil},
		/*  5 */ {`"abc"[1]`, `b`, nil},
		/*  6 */ {`#"abc"`, int64(3), nil},
		/*  7 */ {`"192.168.0.240" / "."`, array.NewArrayA("192", "168", "0", "240"), nil},
		/*  8 */ {`("192.168.0.240" / ".")[1]`, "168", nil},
		/*  9 */ {`"AF3B0Dz" / 2`, array.NewArrayA("AF", "3B", "0D", "z"), nil},
		/* 10 */ {`"AF3B0Dz" / 0`, nil, "[1:12] division by zero"},
	}

	// runTestSuiteSpec(t, section, inputs, 8)
	RunTestSuite(t, section, inputs)
}
