Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestUnpackListExprAllocs (0.14 sec)

  1. src/cmd/compile/internal/syntax/parser_test.go

    		}
    		if col := pos.RelCol(); col != test.col {
    			t.Errorf("%s: got col = %d; want %d", test.src, col, test.col)
    		}
    	}
    }
    
    // Test that typical uses of UnpackListExpr don't allocate.
    func TestUnpackListExprAllocs(t *testing.T) {
    	var x Expr = NewName(Pos{}, "x")
    	allocs := testing.AllocsPerRun(1000, func() {
    		list := UnpackListExpr(x)
    		if len(list) != 1 || list[0] != x {
    			t.Fatalf("unexpected result")
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 16:30:19 UTC 2024
    - 12.2K bytes
    - Viewed (0)
Back to top