/
githubmirror
/
syncthing
Обзор
Документация
Войти
/
githubmirror
/
syncthing
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/sliceutil/sliceutil_test.go
28 строк
652 B
Jakob Borg
all: Use some Go 1.21 features (#9409)
10 фев 2024, 23:02
Не верифицирован
10 фев 2024, 23:02
e1dd365
Код
Авторство
О чём код?
// Copyright (C) 2023 The Syncthing Authors. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. package sliceutil_test import ( "slices" "testing" "github.com/syncthing/syncthing/lib/sliceutil" ) func TestRemoveAndZero(t *testing.T) { a := []int{1, 2, 3, 4, 5} b := sliceutil.RemoveAndZero(a, 2) exp := []int{1, 2, 4, 5} if !slices.Equal(b, exp) { t.Errorf("got %v, expected %v", b, exp) } for _, e := range a { if e == 3 { t.Errorf("element should have been zeroed") } } }