Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestCompact (0.11 sec)

  1. src/slices/slices_test.go

    		[]int{1, 1, 2},
    		[]int{1, 2},
    	},
    	{
    		"unsorted",
    		[]int{1, 2, 1},
    		[]int{1, 2, 1},
    	},
    	{
    		"many",
    		[]int{1, 2, 2, 3, 3, 4},
    		[]int{1, 2, 3, 4},
    	},
    }
    
    func TestCompact(t *testing.T) {
    	for _, test := range compactTests {
    		copy := Clone(test.s)
    		if got := Compact(copy); !Equal(got, test.want) {
    			t.Errorf("Compact(%v) = %v, want %v", test.s, got, test.want)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
Back to top