ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //proc/self/root/opt/go/pkg/mod/github.com/aws/[email protected]/internal/ini/sep_tokens_test.go
//go:build go1.7
// +build go1.7

package ini

import (
	"reflect"
	"testing"
)

func TestIsSep(t *testing.T) {
	cases := []struct {
		b        []rune
		expected bool
	}{
		{
			b: []rune(``),
		},
		{
			b: []rune(`"wee"`),
		},
		{
			b:        []rune("["),
			expected: true,
		},
		{
			b:        []rune("]"),
			expected: true,
		},
	}

	for i, c := range cases {
		if e, a := c.expected, isSep(c.b); e != a {
			t.Errorf("%d: expected %t, but received %t", i+0, e, a)
		}
	}
}

func TestNewSep(t *testing.T) {
	cases := []struct {
		b             []rune
		expectedRead  int
		expectedError bool
		expectedToken Token
	}{
		{
			b:             []rune("["),
			expectedRead:  1,
			expectedToken: newToken(TokenSep, []rune("["), NoneType),
		},
		{
			b:             []rune("]"),
			expectedRead:  1,
			expectedToken: newToken(TokenSep, []rune("]"), NoneType),
		},
	}

	for i, c := range cases {
		tok, n, err := newSepToken(c.b)

		if e, a := c.expectedToken, tok; !reflect.DeepEqual(e, a) {
			t.Errorf("%d: expected %v, but received %v", i+1, e, a)
		}

		if e, a := c.expectedRead, n; e != a {
			t.Errorf("%d: expected %v, but received %v", i+1, e, a)
		}

		if e, a := c.expectedError, err != nil; e != a {
			t.Errorf("%d: expected %v, but received %v", i+1, e, a)
		}
	}
}