/* * 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 main import ( "testing" ) func TestGetLinkNext(t *testing.T) { link := `; rel="next", ; rel="first", ; rel="last"` expected := `https://gitlab.com/api/v4/projects?imported=false&include_hidden=false&membership=false&order_by=created_at&owned=true&page=2&per_page=20&repository_checksum_failed=false&simple=false&sort=desc&starred=false&statistics=false&wiki_checksum_failed=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false` if actual := getLinkNext(link); actual != expected { t.Errorf("got '%s'; expected '%s'", actual, expected) } }