text
stringlengths
93
16.4k
id
stringlengths
20
40
metadata
dict
input_ids
listlengths
45
2.05k
attention_mask
listlengths
45
2.05k
complexity
int64
1
9
func TestExpectedMethodCall_CustomStruct(t *testing.T) { reporter, ctrl := createFixtures(t) subject := new(Subject) expectedArg0 := TestStruct{Number: 123, Message: "hello"} ctrl.RecordCall(subject, "ActOnTestStructMethod", expectedArg0, 15) ctrl.Call(subject, "ActOnTestStructMethod", expectedArg0, 15) reporter.assertPass("Expected method call made.") }
explode_data.jsonl/17273
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 116 }
[ 2830, 3393, 18896, 3523, 7220, 57402, 9422, 1155, 353, 8840, 836, 8, 341, 69931, 261, 11, 23743, 1669, 1855, 25958, 18513, 1155, 340, 28624, 583, 1669, 501, 7, 13019, 692, 42400, 2735, 15, 1669, 3393, 9422, 90, 2833, 25, 220, 16, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestServerAddCommand(t *testing.T) { serverTableInit(t) listReq := tableCmdReq{ Cmd: "list", } var ref string for i := 0; i < 3; i++ { for j := 0; j < 3; j++ { addReq := tableCmdReq{ Cmd: "add", Cluster: "clst1", Service: "svc1", Db: "st_table_http_test" + strconv.Itoa(i), Table: "table_http_test" + strconv.Itoa(j), Output: "kafka", OutputFormat: "json", } tableRequest(addReq, http.StatusOK, t) resp := tableRequest(listReq, http.StatusOK, t) ref += `{"Cluster":"clst1","Service":"svc1","Db":"st_table_http_test` + strconv.Itoa(i) + `","Table":"table_http_test` + strconv.Itoa(j) + `","Input":"mysql","Output":"kafka","Version":0,"OutputFormat":"json"} ` log.Debugf("ref %+v", ref) if string(resp.Body.Bytes()) != ref { t.Fatalf("wrong response: '%v'", string(resp.Body.Bytes())) } } } delAllReq := tableCmdReq{ Cmd: "del", Cluster: "*", Service: "*", Db: "*", Table: "*", Output: "kafka", Apply: "yes", } tableRequest(delAllReq, http.StatusOK, t) resp := tableRequest(listReq, http.StatusOK, t) if string(resp.Body.Bytes()) != `` { t.Fatalf("wrong response1: '%v'", string(resp.Body.Bytes())) } addReq := tableCmdReq{ Cmd: "add", Service: "svc1", Cluster: "clst1", Db: "st_table_http_test%", Table: "table_http_test%", Output: "kafka", OutputFormat: "json", } tableRequest(addReq, http.StatusOK, t) resp = tableRequest(listReq, http.StatusOK, t) if string(resp.Body.Bytes()) != ref { t.Fatalf("wrong response: '%v'", string(resp.Body.Bytes())) } tableRequest(delAllReq, http.StatusOK, t) resp = tableRequest(listReq, http.StatusOK, t) if string(resp.Body.Bytes()) != `` { t.Fatalf("wrong response1: '%v'", string(resp.Body.Bytes())) } }
explode_data.jsonl/53588
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 891 }
[ 2830, 3393, 5475, 2212, 4062, 1155, 353, 8840, 836, 8, 341, 41057, 2556, 3803, 1155, 692, 14440, 27234, 1669, 1965, 15613, 27234, 515, 197, 6258, 2277, 25, 330, 1607, 756, 197, 630, 2405, 2053, 914, 198, 2023, 600, 1669, 220, 15, 26, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
func TestFFmpegSplitTimes(t *testing.T) { // We need to make up last track's duration: 3 minutes. totaltime := float64(17*60 + 4 + 3*60) want := []struct { track int start string duration string }{ {track: 0, start: "00:00:00.000", duration: "00:06:40.360"}, {track: 1, start: "00:06:40.360", duration: "00:04:13.640"}, {track: 3, start: "00:17:04.000", duration: "00:03:00.000"}, {track: 4, start: "", duration: ""}, {track: 8, start: "", duration: ""}, } buf, err := ioutil.ReadFile(sampleCuesheet) if err != nil { panic(err) } sheet, err := cuesheet.New(buf) if err != nil { panic(err) } for _, v := range want { start, duration := ffmpegSplitTimes(sheet, "Faithless - Live in Berlin (CD1).mp3", v.track, totaltime) if start != v.start || duration != v.duration { t.Errorf("Got {start: %v, duration: %v}, want {start: %v, duration: %v}", start, duration, v.start, v.duration) } } }
explode_data.jsonl/68145
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 385 }
[ 2830, 3393, 1748, 47551, 20193, 18889, 1155, 353, 8840, 836, 8, 341, 197, 322, 1205, 1184, 311, 1281, 705, 1537, 3754, 594, 8090, 25, 220, 18, 4420, 624, 34493, 1678, 1669, 2224, 21, 19, 7, 16, 22, 9, 21, 15, 488, 220, 19, 488, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestCatalog_NodeServices_ConnectProxy(t *testing.T) { t.Parallel() assert := assert.New(t) dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() codec := rpcClient(t, s1) defer codec.Close() testrpc.WaitForLeader(t, s1.RPC, "dc1") // Register the service args := structs.TestRegisterRequestProxy(t) var out struct{} assert.Nil(msgpackrpc.CallWithCodec(codec, "Catalog.Register", args, &out)) // List req := structs.NodeSpecificRequest{ Datacenter: "dc1", Node: args.Node, } var resp structs.IndexedNodeServices assert.Nil(msgpackrpc.CallWithCodec(codec, "Catalog.NodeServices", &req, &resp)) assert.Len(resp.NodeServices.Services, 1) v := resp.NodeServices.Services[args.Service.Service] assert.Equal(structs.ServiceKindConnectProxy, v.Kind) assert.Equal(args.Service.Proxy.DestinationServiceName, v.Proxy.DestinationServiceName) }
explode_data.jsonl/49242
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 337 }
[ 2830, 3393, 41606, 41340, 11025, 15100, 2321, 16219, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 6948, 1669, 2060, 7121, 1155, 340, 48532, 16, 11, 274, 16, 1669, 1273, 5475, 1155, 340, 16867, 2643, 84427, 14161, 16, 340, 1686...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestSetupForwardAgent(t *testing.T) { a, b, err := netPipe() if err != nil { t.Fatalf("netPipe: %v", err) } defer a.Close() defer b.Close() _, socket, cleanup := startOpenSSHAgent(t) defer cleanup() serverConf := ssh.ServerConfig{ NoClientAuth: true, } serverConf.AddHostKey(testSigners["rsa"]) incoming := make(chan *ssh.ServerConn, 1) go func() { conn, _, _, err := ssh.NewServerConn(a, &serverConf) if err != nil { t.Fatalf("Server: %v", err) } incoming <- conn }() conf := ssh.ClientConfig{ HostKeyCallback: ssh.InsecureIgnoreHostKey(), } conn, chans, reqs, err := ssh.NewClientConn(b, "", &conf) if err != nil { t.Fatalf("NewClientConn: %v", err) } client := ssh.NewClient(conn, chans, reqs) if err := ForwardToRemote(client, socket); err != nil { t.Fatalf("SetupForwardAgent: %v", err) } server := <-incoming ch, reqs, err := server.OpenChannel(channelType, nil) if err != nil { t.Fatalf("OpenChannel(%q): %v", channelType, err) } go ssh.DiscardRequests(reqs) agentClient := NewClient(ch) testAgentInterface(t, agentClient, testPrivateKeys["rsa"], nil, 0) conn.Close() }
explode_data.jsonl/68408
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 458 }
[ 2830, 3393, 21821, 25925, 16810, 1155, 353, 8840, 836, 8, 341, 11323, 11, 293, 11, 1848, 1669, 4179, 34077, 741, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 4711, 34077, 25, 1018, 85, 497, 1848, 340, 197, 630, 16867, 264, 10421,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestReplicateRepository(t *testing.T) { t.Parallel() cfgBuilder := testcfg.NewGitalyCfgBuilder(testcfg.WithStorages("default", "replica")) cfg := cfgBuilder.Build(t) testhelper.BuildGitalyHooks(t, cfg) testhelper.BuildGitalySSH(t, cfg) serverSocketPath := runRepositoryServerWithConfig(t, cfg, nil, testserver.WithDisablePraefect()) cfg.SocketPath = serverSocketPath client := newRepositoryClient(t, cfg, serverSocketPath) repo, repoPath := gittest.CloneRepo(t, cfg, cfg.Storages[0]) // create a loose object to ensure snapshot replication is used blobData, err := text.RandomHex(10) require.NoError(t, err) blobID := text.ChompBytes(gittest.ExecStream(t, cfg, bytes.NewBuffer([]byte(blobData)), "-C", repoPath, "hash-object", "-w", "--stdin")) // write info attributes attrFilePath := filepath.Join(repoPath, "info", "attributes") attrData := []byte("*.pbxproj binary\n") require.NoError(t, ioutil.WriteFile(attrFilePath, attrData, 0644)) // Write a modified gitconfig gittest.Exec(t, cfg, "-C", repoPath, "config", "please.replicate", "me") configData := testhelper.MustReadFile(t, filepath.Join(repoPath, "config")) require.Contains(t, string(configData), "[please]\n\treplicate = me\n") targetRepo := proto.Clone(repo).(*gitalypb.Repository) targetRepo.StorageName = cfg.Storages[1].Name ctx, cancel := testhelper.Context() defer cancel() md := testhelper.GitalyServersMetadataFromCfg(t, cfg) injectedCtx := metadata.NewOutgoingContext(ctx, md) _, err = client.ReplicateRepository(injectedCtx, &gitalypb.ReplicateRepositoryRequest{ Repository: targetRepo, Source: repo, }) require.NoError(t, err) targetRepoPath := filepath.Join(cfg.Storages[1].Path, targetRepo.GetRelativePath()) gittest.Exec(t, cfg, "-C", targetRepoPath, "fsck") replicatedAttrFilePath := filepath.Join(targetRepoPath, "info", "attributes") replicatedAttrData := testhelper.MustReadFile(t, replicatedAttrFilePath) require.Equal(t, string(attrData), string(replicatedAttrData), "info/attributes files must match") replicatedConfigPath := filepath.Join(targetRepoPath, "config") replicatedConfigData := testhelper.MustReadFile(t, replicatedConfigPath) require.Equal(t, string(configData), string(replicatedConfigData), "config files must match") // create another branch gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch("branch")) _, err = client.ReplicateRepository(injectedCtx, &gitalypb.ReplicateRepositoryRequest{ Repository: targetRepo, Source: repo, }) require.NoError(t, err) require.Equal(t, gittest.Exec(t, cfg, "-C", repoPath, "show-ref", "--hash", "--verify", "refs/heads/branch"), gittest.Exec(t, cfg, "-C", targetRepoPath, "show-ref", "--hash", "--verify", "refs/heads/branch"), ) // if an unreachable object has been replicated, that means snapshot replication was used gittest.Exec(t, cfg, "-C", targetRepoPath, "cat-file", "-p", blobID) }
explode_data.jsonl/64810
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1073 }
[ 2830, 3393, 18327, 48795, 4624, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 50286, 3297, 1669, 1273, 14072, 7121, 38, 2174, 88, 42467, 3297, 8623, 14072, 26124, 623, 269, 1134, 445, 2258, 497, 330, 9995, 15317, 5455, 50286, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGenericWedge(t *testing.T) { g := initDemoCircle() red, blue := color.RGBA{0xff, 0, 0, 0}, color.RGBA{0, 0, 0xff, 0} s := chart.Style{Symbol: '#', FillColor: red, LineColor: blue} ra := math.Pi / 2 chart.GenericWedge(g, 30, 20, r, ri, 0.15*ra, 0.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) chart.GenericWedge(g, 30, 20, r, ri, 1.15*ra, 1.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) chart.GenericWedge(g, 30, 20, r, ri, 2.15*ra, 2.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) chart.GenericWedge(g, 30, 20, r, ri, 3.15*ra, 3.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) // mored than one quadrant g = initDemoCircle() chart.GenericWedge(g, 30, 20, r, ri, 0.15*ra, 1.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) chart.GenericWedge(g, 30, 20, r, ri, 2.15*ra, 3.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) g = initDemoCircle() chart.GenericWedge(g, 30, 20, r, ri, 1.5*ra, 2.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) // all 4 quadrants g = initDemoCircle() chart.GenericWedge(g, 30, 20, r, ri, 1.5*ra, 0.5*ra, 1.5, s) fmt.Printf("\n%s\n", g.String()) }
explode_data.jsonl/63958
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 587 }
[ 2830, 3393, 19964, 54, 7186, 1155, 353, 8840, 836, 8, 341, 3174, 1669, 2930, 37413, 25199, 741, 197, 1151, 11, 6303, 1669, 1894, 80114, 32, 90, 15, 9020, 11, 220, 15, 11, 220, 15, 11, 220, 15, 2137, 1894, 80114, 32, 90, 15, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestFilteringServerWatchSrvVSchemaFiltersPassthroughSrvVSchema(t *testing.T) { _, mock, f := newFiltering(stockFilters) allowed := map[string]bool{} for _, ks := range stockFilters { allowed[ks] = true } // we need to verify that the nested callback actually gets called wg := sync.WaitGroup{} wg.Add(1) cb := func(gotSchema *vschemapb.SrvVSchema, gotErr error) bool { // ensure that only selected keyspaces made it into the callback for name, ks := range gotSchema.Keyspaces { if !allowed[name] { t.Errorf("Unexpected keyspace found in callback: %v", ks) } wantKS := mock.WatchedSrvVSchema.Keyspaces[name] if !reflect.DeepEqual(ks, wantKS) { t.Errorf( "Expected keyspace to be passed through unmodified: want %#v got %#v", wantKS, ks, ) } } wg.Done() return true } f.WatchSrvVSchema(stockCtx, stockCell, cb) wg.Wait() }
explode_data.jsonl/2382
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 377 }
[ 2830, 3393, 5632, 287, 5475, 14247, 50, 10553, 53, 8632, 28351, 70911, 86901, 50, 10553, 53, 8632, 1155, 353, 8840, 836, 8, 341, 197, 6878, 7860, 11, 282, 1669, 501, 5632, 287, 67471, 28351, 692, 197, 20967, 1669, 2415, 14032, 96436, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestRawRequestWithData(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(HandleRaw)) defer srv.Close() var payload = bytes.NewBufferString("napping") res := structType{} req := Request{ Url: "http://" + srv.Listener.Addr().String(), Method: "PUT", RawPayload: true, Payload: payload, Result: &res, } resp, err := Send(&req) if err != nil { t.Error(err) } assert.Equal(t, resp.Status(), 200) assert.Equal(t, res.Bar, "napping") }
explode_data.jsonl/14817
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 209 }
[ 2830, 3393, 20015, 1900, 80356, 1155, 353, 8840, 836, 8, 341, 1903, 10553, 1669, 54320, 70334, 7121, 5475, 19886, 89164, 90832, 20015, 1171, 16867, 43578, 10421, 2822, 2405, 7729, 284, 5820, 7121, 4095, 703, 445, 77, 3629, 1138, 10202, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func Test_CSRF(t *testing.T) { app := fiber.New() app.Use(New()) app.Post("/", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) }) h := app.Handler() ctx := &fasthttp.RequestCtx{} // Generate CSRF token ctx.Request.Header.SetMethod("GET") h(ctx) utils.AssertEqual(t, true, strings.Contains(string(ctx.Response.Header.Peek(fiber.HeaderSetCookie)), "_csrf")) // Without CSRF cookie ctx.Request.Reset() ctx.Response.Reset() ctx.Request.Header.SetMethod("POST") h(ctx) utils.AssertEqual(t, 403, ctx.Response.StatusCode()) // Empty/invalid CSRF token ctx.Request.Reset() ctx.Response.Reset() ctx.Request.Header.SetMethod("POST") ctx.Request.Header.Set("X-CSRF-Token", "johndoe") h(ctx) utils.AssertEqual(t, 403, ctx.Response.StatusCode()) // Valid CSRF token token := utils.UUID() ctx.Request.Reset() ctx.Response.Reset() ctx.Request.Header.SetMethod("POST") ctx.Request.Header.Set(fiber.HeaderCookie, "_csrf="+token) ctx.Request.Header.Set("X-CSRF-Token", token) h(ctx) utils.AssertEqual(t, 200, ctx.Response.StatusCode()) }
explode_data.jsonl/54022
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 434 }
[ 2830, 3393, 81449, 37, 1155, 353, 8840, 836, 8, 341, 28236, 1669, 23788, 7121, 2822, 28236, 9046, 35063, 12367, 28236, 23442, 35460, 2915, 1337, 353, 82945, 727, 3998, 8, 1465, 341, 197, 853, 272, 20176, 2522, 955, 8629, 52989, 340, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestAddrWire(t *testing.T) { // A couple of NetAddresses to use for testing. na := &btcwire.NetAddress{ Timestamp: time.Unix(0x495fab29, 0), // 2009-01-03 12:15:05 -0600 CST Services: btcwire.SFNodeNetwork, IP: net.ParseIP("127.0.0.1"), Port: 8333, } na2 := &btcwire.NetAddress{ Timestamp: time.Unix(0x495fab29, 0), // 2009-01-03 12:15:05 -0600 CST Services: btcwire.SFNodeNetwork, IP: net.ParseIP("192.168.0.1"), Port: 8334, } // Empty address message. noAddr := btcwire.NewMsgAddr() noAddrEncoded := []byte{ 0x00, // Varint for number of addresses } // Address message with multiple addresses. multiAddr := btcwire.NewMsgAddr() multiAddr.AddAddresses(na, na2) multiAddrEncoded := []byte{ 0x02, // Varint for number of addresses 0x29, 0xab, 0x5f, 0x49, // Timestamp 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // SFNodeNetwork 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01, // IP 127.0.0.1 0x20, 0x8d, // Port 8333 in big-endian 0x29, 0xab, 0x5f, 0x49, // Timestamp 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // SFNodeNetwork 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xa8, 0x00, 0x01, // IP 192.168.0.1 0x20, 0x8e, // Port 8334 in big-endian } tests := []struct { in *btcwire.MsgAddr // Message to encode out *btcwire.MsgAddr // Expected decoded message buf []byte // Wire encoding pver uint32 // Protocol version for wire encoding }{ // Latest protocol version with no addresses. { noAddr, noAddr, noAddrEncoded, btcwire.ProtocolVersion, }, // Latest protocol version with multiple addresses. { multiAddr, multiAddr, multiAddrEncoded, btcwire.ProtocolVersion, }, // Protocol version MultipleAddressVersion-1 with no addresses. { noAddr, noAddr, noAddrEncoded, btcwire.MultipleAddressVersion - 1, }, } t.Logf("Running %d tests", len(tests)) for i, test := range tests { // Encode the message to wire format. var buf bytes.Buffer err := test.in.BtcEncode(&buf, test.pver) if err != nil { t.Errorf("BtcEncode #%d error %v", i, err) continue } if !bytes.Equal(buf.Bytes(), test.buf) { t.Errorf("BtcEncode #%d\n got: %s want: %s", i, spew.Sdump(buf.Bytes()), spew.Sdump(test.buf)) continue } // Decode the message from wire format. var msg btcwire.MsgAddr rbuf := bytes.NewReader(test.buf) err = msg.BtcDecode(rbuf, test.pver) if err != nil { t.Errorf("BtcDecode #%d error %v", i, err) continue } if !reflect.DeepEqual(&msg, test.out) { t.Errorf("BtcDecode #%d\n got: %s want: %s", i, spew.Sdump(msg), spew.Sdump(test.out)) continue } } }
explode_data.jsonl/53713
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1329 }
[ 2830, 3393, 13986, 37845, 1155, 353, 8840, 836, 8, 341, 197, 322, 362, 5625, 315, 9374, 52290, 311, 990, 369, 7497, 624, 197, 3376, 1669, 609, 92634, 35531, 16993, 4286, 515, 197, 10261, 4702, 25, 882, 10616, 941, 7, 15, 87, 19, 24,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestRESTClientQPS(t *testing.T) { targetTimestamp := 1 tc := restClientTestCase{ desiredMetricValues: PodMetricsInfo{ "test-pod-0": {Value: 10000, Timestamp: offsetTimestampBy(targetTimestamp), Window: metricServerDefaultMetricWindow}, "test-pod-1": {Value: 20000, Timestamp: offsetTimestampBy(targetTimestamp), Window: metricServerDefaultMetricWindow}, "test-pod-2": {Value: 10000, Timestamp: offsetTimestampBy(targetTimestamp), Window: metricServerDefaultMetricWindow}, }, metricName: "qps", targetTimestamp: targetTimestamp, reportedMetricPoints: []metricPoint{{10000, 1}, {20000, 1}, {10000, 1}}, } tc.runTest(t) }
explode_data.jsonl/64900
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 241 }
[ 2830, 3393, 38307, 2959, 48, 5012, 1155, 353, 8840, 836, 8, 341, 28861, 20812, 1669, 220, 16, 198, 78255, 1669, 2732, 2959, 16458, 515, 197, 52912, 2690, 54310, 6227, 25, 16821, 27328, 1731, 515, 298, 197, 1, 1944, 2268, 347, 12, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestSortedArray_SetUnique(t *testing.T) { gtest.C(t, func(t *gtest.T) { a1 := []interface{}{1, 2, 3, 4, 5, 3, 2, 2, 3, 5, 5} array1 := garray.NewSortedArrayFrom(a1, gutil.ComparatorInt) array1.SetUnique(true) t.Assert(array1.Len(), 5) t.Assert(array1, []interface{}{1, 2, 3, 4, 5}) }) }
explode_data.jsonl/67028
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 148 }
[ 2830, 3393, 51051, 1857, 14812, 22811, 1155, 353, 8840, 836, 8, 341, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 11323, 16, 1669, 3056, 4970, 6257, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGetReaders(t *testing.T) { t.Parallel() v := viper.New() v.SetConfigType("yaml") input := bytes.NewBuffer([]byte(` readers: reader1: type: expvar reader2: type: expvar `)) v.ReadConfig(input) keys, err := getReaders(v) if err != nil { t.Errorf("want nil, got (%v)", err) } if len(keys) != 2 { t.Errorf("len(keys) = (%d); want (2)", len(keys)) } target := []string{"reader1", "reader2"} for rKey := range keys { if !tools.StringInSlice(rKey, target) { t.Errorf("tools.StringInSlice(rKey, target): expected (%s) be in %v", rKey, target) } } // testing known types tcs := []struct { input *bytes.Buffer value string }{ { input: bytes.NewBuffer([]byte(` readers: reader1: type: expvar `)), value: "expvar", }, { input: bytes.NewBuffer([]byte(` readers: reader1: type: self `)), value: "self", }, } for i, tc := range tcs { name := fmt.Sprintf("case_%d", i) t.Run(name, func(t *testing.T) { v.ReadConfig(tc.input) keys, _ := getReaders(v) if len(keys) == 0 { t.Fatalf("len(keys) = 0; want return value (%v)", keys) } for _, v := range keys { if v != tc.value { t.Errorf("v = want (%s); want (%s)", v, tc.value) } } }) } }
explode_data.jsonl/33308
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 648 }
[ 2830, 3393, 1949, 4418, 388, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 5195, 1669, 95132, 7121, 741, 5195, 4202, 2648, 929, 445, 41466, 5130, 22427, 1669, 5820, 7121, 4095, 10556, 3782, 61528, 262, 12726, 510, 286, 6604, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestSchemaRegistryClient_CreateSchemaWithoutReferences(t *testing.T) { { server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { responsePayload := schemaResponse{ Subject: "test1", Version: 1, Schema: "test2", ID: 1, } response, _ := json.Marshal(responsePayload) switch req.URL.String() { case "/subjects/test1-value/versions": requestPayload := schemaRequest{ Schema: "test2", SchemaType: Protobuf.String(), References: []Reference{}, } expected, _ := json.Marshal(requestPayload) // Test payload assert.Equal(t, bodyToString(req.Body), string(expected)) // Send response to be tested rw.Write(response) case "/subjects/test1-value/versions/latest": // Send response to be tested rw.Write(response) default: assert.Error(t, errors.New("unhandled request")) } })) srClient := CreateSchemaRegistryClient(server.URL) srClient.CodecCreationEnabled(false) schema, err := srClient.CreateSchema("test1-value", "test2", Protobuf) // Test response assert.NoError(t, err) assert.Equal(t, schema.id, 1) assert.Nil(t, schema.codec) assert.Equal(t, schema.schema, "test2") assert.Equal(t, schema.version, 1) } { server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { responsePayload := schemaResponse{ Subject: "test1", Version: 1, Schema: "test2", ID: 1, } response, _ := json.Marshal(responsePayload) switch req.URL.String() { case "/subjects/test1/versions": requestPayload := schemaRequest{ Schema: "test2", SchemaType: Avro.String(), References: []Reference{}, } expected, _ := json.Marshal(requestPayload) // Test payload assert.Equal(t, bodyToString(req.Body), string(expected)) // Send response to be tested rw.Write(response) case "/subjects/test1/versions/latest": // Send response to be tested rw.Write(response) default: assert.Error(t, errors.New("unhandled request")) } })) srClient := CreateSchemaRegistryClient(server.URL) srClient.CodecCreationEnabled(false) schema, err := srClient.CreateSchema("test1", "test2", Avro) // Test response assert.NoError(t, err) assert.Equal(t, schema.id, 1) assert.Nil(t, schema.codec) assert.Equal(t, schema.schema, "test2") assert.Equal(t, schema.version, 1) } }
explode_data.jsonl/73762
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1015 }
[ 2830, 3393, 8632, 15603, 2959, 34325, 8632, 26040, 31712, 1155, 353, 8840, 836, 8, 1476, 197, 515, 197, 41057, 1669, 54320, 70334, 7121, 5475, 19886, 89164, 18552, 2601, 86, 1758, 37508, 11, 4232, 353, 1254, 9659, 8, 341, 298, 21735, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestStoreBadRequests(t *testing.T) { defer leaktest.AfterTest(t)() stopper := stop.NewStopper() defer stopper.Stop(context.Background()) store, _ := createTestStore(t, testStoreOpts{createSystemRanges: true}, stopper) txn := newTransaction("test", roachpb.Key("a"), 1 /* priority */, store.cfg.Clock) args1 := getArgs(roachpb.Key("a")) args1.EndKey = roachpb.Key("b") args2 := getArgs(roachpb.RKeyMax) args3 := scanArgs(roachpb.Key("a"), roachpb.Key("a")) args4 := scanArgs(roachpb.Key("b"), roachpb.Key("a")) args5 := scanArgs(roachpb.RKeyMin, roachpb.Key("a")) args6 := scanArgs(keys.RangeDescriptorKey(roachpb.RKey(keys.MinKey)), roachpb.Key("a")) tArgs0, _ := heartbeatArgs(txn, hlc.Timestamp{}) tArgs2, tHeader2 := endTxnArgs(txn, false /* commit */) tHeader2.Txn.Key = roachpb.Key(tHeader2.Txn.Key).Next() tArgs3, tHeader3 := heartbeatArgs(txn, hlc.Timestamp{}) tHeader3.Txn.Key = roachpb.Key(tHeader3.Txn.Key).Next() tArgs4 := pushTxnArgs(txn, txn, roachpb.PUSH_ABORT) tArgs4.PusheeTxn.Key = roachpb.Key(txn.Key).Next() testCases := []struct { args roachpb.Request header *roachpb.Header err string }{ // EndKey for non-Range is invalid. {&args1, nil, "should not be specified"}, // Start key must be less than KeyMax. {&args2, nil, "must be less than"}, // End key must be greater than start. {args3, nil, "must be greater than"}, {args4, nil, "must be greater than"}, // Can't range from local to global. {args5, nil, "must be greater than LocalMax"}, {args6, nil, "is range-local, but"}, // Txn must be specified in Header. {&tArgs0, nil, "no transaction specified"}, // Txn key must be same as the request key. {&tArgs2, &tHeader2, "request key .* should match txn key .*"}, {&tArgs3, &tHeader3, "request key .* should match txn key .*"}, {&tArgs4, nil, "request key .* should match pushee"}, } for i, test := range testCases { t.Run("", func(t *testing.T) { if test.header == nil { test.header = &roachpb.Header{} } if test.header.Txn != nil { assignSeqNumsForReqs(test.header.Txn, test.args) } if _, pErr := kv.SendWrappedWith(context.Background(), store.TestSender(), *test.header, test.args); !testutils.IsPError(pErr, test.err) { t.Errorf("%d expected error %q, got error %v", i, test.err, pErr) } }) } }
explode_data.jsonl/110
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 952 }
[ 2830, 3393, 6093, 17082, 35295, 1155, 353, 8840, 836, 8, 341, 16867, 23352, 1944, 36892, 2271, 1155, 8, 741, 62644, 712, 1669, 2936, 7121, 10674, 712, 741, 16867, 2936, 712, 30213, 5378, 19047, 2398, 57279, 11, 716, 1669, 1855, 2271, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestGameServerAllocationDuringGameServerDeletion(t *testing.T) { t.Parallel() testAllocationRaceCondition := func(t *testing.T, fleet func() *v1alpha1.Fleet, deltaSleep time.Duration, delta func(t *testing.T, flt *v1alpha1.Fleet)) { alpha1 := framework.AgonesClient.StableV1alpha1() flt := fleet() flt.ApplyDefaults() size := int32(10) flt.Spec.Replicas = size flt, err := alpha1.Fleets(defaultNs).Create(flt) if assert.Nil(t, err) { defer alpha1.Fleets(defaultNs).Delete(flt.ObjectMeta.Name, nil) // nolint:errcheck } assert.Equal(t, size, flt.Spec.Replicas) framework.WaitForFleetCondition(t, flt, e2e.FleetReadyCount(flt.Spec.Replicas)) var allocs []string wg := sync.WaitGroup{} wg.Add(2) go func() { for { // this gives room for fleet scaling to go down - makes it more likely for the race condition to fire time.Sleep(100 * time.Millisecond) gsa := &v1alpha1.GameServerAllocation{ObjectMeta: metav1.ObjectMeta{GenerateName: "allocation-"}, Spec: v1alpha1.GameServerAllocationSpec{ Required: metav1.LabelSelector{MatchLabels: map[string]string{v1alpha1.FleetNameLabel: flt.ObjectMeta.Name}}, }} gsa, err = framework.AgonesClient.StableV1alpha1().GameServerAllocations(defaultNs).Create(gsa) if err != nil || gsa.Status.State == v1alpha1.GameServerAllocationUnAllocated { logrus.WithError(err).Info("Allocation ended") break } logrus.WithField("gs", gsa.Status.GameServerName).Info("Allocated") allocs = append(allocs, gsa.Status.GameServerName) } wg.Done() }() go func() { // this tends to force the scaling to happen as we are fleet allocating time.Sleep(deltaSleep) // call the function that makes the change to the fleet logrus.Info("Applying delta function") delta(t, flt) wg.Done() }() wg.Wait() assert.NotEmpty(t, allocs) for _, name := range allocs { gsCheck, err := alpha1.GameServers(defaultNs).Get(name, metav1.GetOptions{}) assert.Nil(t, err) assert.True(t, gsCheck.ObjectMeta.DeletionTimestamp.IsZero()) } } t.Run("scale down", func(t *testing.T) { t.Parallel() testAllocationRaceCondition(t, defaultFleet, time.Second, func(t *testing.T, flt *v1alpha1.Fleet) { const targetScale = int32(0) flt = scaleFleetPatch(t, flt, targetScale) assert.Equal(t, targetScale, flt.Spec.Replicas) }) }) t.Run("recreate update", func(t *testing.T) { t.Parallel() fleet := func() *v1alpha1.Fleet { flt := defaultFleet() flt.Spec.Strategy.Type = appsv1.RecreateDeploymentStrategyType flt.Spec.Template.ObjectMeta.Annotations = map[string]string{key: red} return flt } testAllocationRaceCondition(t, fleet, time.Second, func(t *testing.T, flt *v1alpha1.Fleet) { flt, err := framework.AgonesClient.StableV1alpha1().Fleets(defaultNs).Get(flt.ObjectMeta.Name, metav1.GetOptions{}) assert.Nil(t, err) fltCopy := flt.DeepCopy() fltCopy.Spec.Template.ObjectMeta.Annotations[key] = green _, err = framework.AgonesClient.StableV1alpha1().Fleets(defaultNs).Update(fltCopy) assertSuccessOrUpdateConflict(t, err) }) }) t.Run("rolling update", func(t *testing.T) { t.Parallel() fleet := func() *v1alpha1.Fleet { flt := defaultFleet() flt.Spec.Strategy.Type = appsv1.RollingUpdateDeploymentStrategyType flt.Spec.Template.ObjectMeta.Annotations = map[string]string{key: red} return flt } testAllocationRaceCondition(t, fleet, time.Duration(0), func(t *testing.T, flt *v1alpha1.Fleet) { flt, err := framework.AgonesClient.StableV1alpha1().Fleets(defaultNs).Get(flt.ObjectMeta.Name, metav1.GetOptions{}) assert.Nil(t, err) fltCopy := flt.DeepCopy() fltCopy.Spec.Template.ObjectMeta.Annotations[key] = green _, err = framework.AgonesClient.StableV1alpha1().Fleets(defaultNs).Update(fltCopy) assertSuccessOrUpdateConflict(t, err) }) }) }
explode_data.jsonl/9440
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1604 }
[ 2830, 3393, 4868, 5475, 78316, 16014, 4868, 5475, 1912, 52625, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 18185, 78316, 55991, 10547, 1669, 2915, 1155, 353, 8840, 836, 11, 25099, 2915, 368, 353, 85, 16, 7141, 16, 991, 18973,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestEntrypoint(t *testing.T) { b := &Builder{flags: &BFlags{}, runConfig: &container.Config{}, disableCommit: true} entrypointCmd := "/usr/sbin/nginx" if err := entrypoint(b, []string{entrypointCmd}, nil, ""); err != nil { t.Fatalf("Error should be empty, got: %s", err.Error()) } if b.runConfig.Entrypoint == nil { t.Fatalf("Entrypoint should be set") } var expectedEntrypoint strslice.StrSlice if runtime.GOOS == "windows" { expectedEntrypoint = strslice.StrSlice(append([]string{"cmd"}, "/S", "/C", entrypointCmd)) } else { expectedEntrypoint = strslice.StrSlice(append([]string{"/bin/sh"}, "-c", entrypointCmd)) } if !compareStrSlice(expectedEntrypoint, b.runConfig.Entrypoint) { t.Fatalf("Entrypoint command should be set to %s, got %s", expectedEntrypoint, b.runConfig.Entrypoint) } }
explode_data.jsonl/28283
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 292 }
[ 2830, 3393, 52048, 1082, 781, 1155, 353, 8840, 836, 8, 341, 2233, 1669, 609, 3297, 90, 11161, 25, 609, 33, 9195, 22655, 1598, 2648, 25, 609, 3586, 10753, 22655, 11156, 33441, 25, 830, 630, 48344, 2768, 15613, 1669, 3521, 7063, 72435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestDAGNode(t *testing.T) { t.Run("TreeNode should handle all TreeNode operations", func(t *testing.T) { dagSpec := models.JobSpec{Name: "testdag"} dagSpec2 := models.JobSpec{Name: "testdag"} dagSpec3 := models.JobSpec{Name: "testdag"} node := tree.NewTreeNode(dagSpec) node2 := tree.NewTreeNode(dagSpec2) node3 := tree.NewTreeNode(dagSpec3) assert.Equal(t, "testdag", node.GetName()) assert.Equal(t, []*tree.TreeNode{}, node.Dependents) node.AddDependent(node2) assert.Equal(t, 1, len(node.Dependents)) node.AddDependent(node3) assert.Equal(t, 2, len(node.Dependents)) node2.AddDependent(node3) assert.Equal(t, 1, len(node2.Dependents)) assert.Equal(t, 0, len(node3.Dependents)) }) }
explode_data.jsonl/58931
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 313 }
[ 2830, 3393, 35, 1890, 1955, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 26597, 1265, 3705, 678, 17111, 7525, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2698, 351, 8327, 1669, 4119, 45293, 8327, 63121, 25, 330, 1944, 50641, 1670...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestCaptureFifoToFile(t *testing.T) { fifoPath := filepath.Join(testDataPath, "TestCaptureFifoToFile") if err := syscall.Mkfifo(fifoPath, 0700); err != nil { t.Fatalf("Unexpected error during syscall.Mkfifo call: %v", err) } defer os.Remove(fifoPath) f, err := os.OpenFile(fifoPath, os.O_RDWR, 0600) if err != nil { t.Fatalf("Failed to open file, %q: %v", fifoPath, err) } expectedBytes := []byte("Hello world!") f.Write(expectedBytes) defer f.Close() time.AfterFunc(250*time.Millisecond, func() { f.Close() }) logPath := fifoPath + ".log" logFile, err := os.OpenFile(logPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) if err != nil { t.Fatalf("Failed to create log file: %v", err) } var wg sync.WaitGroup wg.Add(1) testWriter := &fctesting.TestWriter{ WriteFn: func(b []byte) (int, error) { defer wg.Done() return logFile.Write(b) }, } m := &Machine{ exitCh: make(chan struct{}), } if err := m.captureFifoToFile(context.Background(), fctesting.NewLogEntry(t), fifoPath, testWriter); err != nil { t.Errorf("Unexpected error: %v", err) } defer os.Remove(logPath) wg.Wait() _, err = os.Stat(logPath) assert.NoError(t, err, "failed to stat file") b, err := ioutil.ReadFile(logPath) assert.NoError(t, err, "failed to read logPath") assert.Equal(t, expectedBytes, b) }
explode_data.jsonl/70440
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 561 }
[ 2830, 3393, 27429, 37, 31497, 41550, 1155, 353, 8840, 836, 8, 341, 1166, 31497, 1820, 1669, 26054, 22363, 8623, 1043, 1820, 11, 330, 2271, 27429, 37, 31497, 41550, 5130, 743, 1848, 1669, 49345, 1321, 74, 74031, 955, 31497, 1820, 11, 220...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestVerifyInclusion(t *testing.T) { ctx := context.Background() env, client := clientEnvForTest(ctx, t, stestonly.PreorderedLogTree) defer env.Close() // Add a few test leaves. leafData := [][]byte{ []byte("A"), []byte("B"), } if err := addSequencedLeaves(ctx, env, client, leafData); err != nil { t.Fatalf("Failed to add leaves: %v", err) } for _, l := range leafData { if err := client.VerifyInclusion(ctx, l); err != nil { t.Errorf("VerifyInclusion(%s) = %v, want nil", l, err) } } }
explode_data.jsonl/54601
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 208 }
[ 2830, 3393, 32627, 641, 8957, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 57538, 11, 2943, 1669, 2943, 14359, 2461, 2271, 7502, 11, 259, 11, 357, 477, 3243, 28770, 10544, 2201, 6533, 340, 16867, 6105, 10421, 2822, 197, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestUnmarshalNext(t *testing.T) { // We only need to check against a few, not all of them. tests := unmarshalingTests[:5] // Create a buffer with many concatenated JSON objects. var b bytes.Buffer for _, tt := range tests { b.WriteString(tt.json) } dec := json.NewDecoder(&b) for _, tt := range tests { // Make a new instance of the type of our expected object. p := reflect.New(reflect.TypeOf(tt.pb).Elem()).Interface().(proto.Message) err := tt.unmarshaler.UnmarshalNext(dec, p) if err != nil { t.Errorf("%s: %v", tt.desc, err) continue } // For easier diffs, compare text strings of the protos. exp := proto.MarshalTextString(tt.pb) act := proto.MarshalTextString(p) if string(exp) != string(act) { t.Errorf("%s: got [%s] want [%s]", tt.desc, act, exp) } } p := &pb.Simple{} err := new(Unmarshaler).UnmarshalNext(dec, p) if err != io.EOF { t.Errorf("eof: got %v, expected io.EOF", err) } }
explode_data.jsonl/63123
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 392 }
[ 2830, 3393, 1806, 27121, 5847, 1155, 353, 8840, 836, 8, 341, 197, 322, 1205, 1172, 1184, 311, 1779, 2348, 264, 2421, 11, 537, 678, 315, 1105, 624, 78216, 1669, 650, 36239, 6132, 18200, 3447, 20, 2533, 197, 322, 4230, 264, 4147, 448, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestServer_Response_TransferEncoding_chunked(t *testing.T) { const msg = "hi" testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { w.Header().Set("Transfer-Encoding", "chunked") // should be stripped io.WriteString(w, msg) return nil }, func(st *serverTester) { getSlash(st) hf := st.wantHeaders() goth := st.decodeHeader(hf.HeaderBlockFragment()) wanth := [][2]string{ {":status", "200"}, {"content-type", "text/plain; charset=utf-8"}, {"content-length", strconv.Itoa(len(msg))}, } if !reflect.DeepEqual(goth, wanth) { t.Errorf("Got headers %v; want %v", goth, wanth) } }) }
explode_data.jsonl/71664
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 265 }
[ 2830, 3393, 5475, 65873, 34932, 802, 14690, 30539, 291, 1155, 353, 8840, 836, 8, 341, 4777, 3750, 284, 330, 6023, 698, 18185, 5475, 2582, 1155, 11, 2915, 3622, 1758, 37508, 11, 435, 353, 1254, 9659, 8, 1465, 341, 197, 6692, 15753, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGetAnalyticsOld(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() defer th.TearDown() Client := th.Client rows, resp := Client.GetAnalyticsOld("", "") CheckForbiddenStatus(t, resp) if rows != nil { t.Fatal("should be nil") } rows, resp = th.SystemAdminClient.GetAnalyticsOld("", "") CheckNoError(t, resp) found := false for _, row := range rows { if row.Name == "unique_user_count" { found = true } } if !found { t.Fatal("should return unique user count") } _, resp = th.SystemAdminClient.GetAnalyticsOld("post_counts_day", "") CheckNoError(t, resp) _, resp = th.SystemAdminClient.GetAnalyticsOld("user_counts_with_posts_day", "") CheckNoError(t, resp) _, resp = th.SystemAdminClient.GetAnalyticsOld("extra_counts", "") CheckNoError(t, resp) _, resp = th.SystemAdminClient.GetAnalyticsOld("", th.BasicTeam.Id) CheckNoError(t, resp) Client.Logout() _, resp = Client.GetAnalyticsOld("", th.BasicTeam.Id) CheckUnauthorizedStatus(t, resp) }
explode_data.jsonl/10691
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 379 }
[ 2830, 3393, 1949, 60539, 18284, 1155, 353, 8840, 836, 8, 341, 70479, 1669, 18626, 1005, 3803, 15944, 1005, 3803, 2320, 7210, 741, 16867, 270, 836, 682, 4454, 741, 71724, 1669, 270, 11716, 271, 68438, 11, 9039, 1669, 8423, 2234, 60539, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestPlatform_GetTokenListByAddress(t *testing.T) { server := httptest.NewServer(createMockedAPI()) defer server.Close() p := Init(server.URL, server.URL) res, err := p.GetTokenListIdsByAddress("TM1zzNDZD2DPASbKcgdVoTYhfmYgtfwx9R") assert.Nil(t, err) sort.Slice(res, func(i, j int) bool { return res[i] < res[j] }) rawRes, err := json.Marshal(res) assert.Nil(t, err) assert.JSONEq(t, wantedTokensResponse, string(rawRes)) }
explode_data.jsonl/24907
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 186 }
[ 2830, 3393, 17296, 13614, 3323, 852, 1359, 4286, 1155, 353, 8840, 836, 8, 341, 41057, 1669, 54320, 70334, 7121, 5475, 32602, 11571, 291, 7082, 2398, 16867, 3538, 10421, 2822, 3223, 1669, 15690, 21421, 20893, 11, 3538, 20893, 340, 10202, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestPreparedCommand_Run_Fail(t *testing.T) { stderr := shx.RecordStderr() defer stderr.Release() err := shx.Run("go", "run") gotStderr := stderr.Output() if err == nil { t.Fatal("expected shx.Command to fail") } wantStderr := "no go files listed" assert.Contains(t, gotStderr, wantStderr) }
explode_data.jsonl/57093
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 128 }
[ 2830, 3393, 4703, 7212, 4062, 84158, 1400, 604, 1155, 353, 8840, 836, 8, 341, 6736, 615, 1669, 557, 87, 49959, 22748, 615, 741, 16867, 26436, 58693, 2822, 9859, 1669, 557, 87, 16708, 445, 3346, 497, 330, 6108, 1138, 3174, 354, 22748, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestAbsCollection_Random(t *testing.T) { intColl := NewIntCollection([]int{1, 2, 3, 4, 5, 6}) out := intColl.Random() _, err := out.ToInt() if err != nil { t.Fatal(err.Error()) } }
explode_data.jsonl/66448
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 82 }
[ 2830, 3393, 27778, 6482, 2568, 2206, 1155, 353, 8840, 836, 8, 341, 2084, 15265, 1669, 1532, 1072, 6482, 10556, 396, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 3518, 13967, 1669, 526, 15265, 26709, 282...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestDesmosCLIProfileCreate_noFlags(t *testing.T) { t.Parallel() f := InitFixtures(t) // Start Desmosd server proc := f.GDStart() defer proc.Stop(false) // Save key addresses for later use fooAddr := f.KeyAddress(keyFoo) // Later usage variables fooAcc := f.QueryAccount(fooAddr) startTokens := sdk.TokensFromConsensusPower(140) require.Equal(t, startTokens, fooAcc.GetCoins().AmountOf(denom)) // Create a profile success, _, sterr := f.TxProfileSave("mrBrown", fooAddr, "-y") require.True(t, success) require.Empty(t, sterr) tests.WaitForNextNBlocksTM(1, f.Port) // Make sure the profile is saved storedProfiles := f.QueryProfiles() require.NotEmpty(t, storedProfiles) profile := storedProfiles[0] require.Equal(t, profile.DTag, "mrBrown") // Test --dry-run success, _, _ = f.TxProfileSave("mrBrown", fooAddr, "--dry-run") require.True(t, success) // Test --generate-only success, stdout, stderr := f.TxProfileSave("mrBrown", fooAddr, "--generate-only=true") require.Empty(t, stderr) require.True(t, success) msg := unmarshalStdTx(f.T, stdout) require.NotZero(t, msg.Fee.Gas) require.Len(t, msg.Msgs, 1) require.Len(t, msg.GetSignatures(), 0) // Check state didn't change storedProfiles = f.QueryProfiles() require.Len(t, storedProfiles, 1) f.Cleanup() }
explode_data.jsonl/29798
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 498 }
[ 2830, 3393, 4896, 8631, 63959, 8526, 4021, 6536, 9195, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 1166, 1669, 15690, 25958, 18513, 1155, 692, 197, 322, 5145, 3874, 8631, 67, 3538, 198, 197, 15782, 1669, 282, 1224, 35, 3479, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestFormatFMDataWithInvalidFile(t *testing.T) { fmConfig := config.FMConfig{ DestinationDir: "./tmp", Source: "source", NodeID: "123", Host: "host", } fileName := "./tmp.json" var buf bytes.Buffer log.SetOutput(&buf) defer func() { log.SetOutput(os.Stderr) }() FormatFMData(fileName, fmConfig, "") if !strings.Contains(buf.String(), "no such file or directory") { t.Fail() } }
explode_data.jsonl/46222
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 191 }
[ 2830, 3393, 4061, 25609, 1043, 2354, 7928, 1703, 1155, 353, 8840, 836, 8, 341, 1166, 76, 2648, 1669, 2193, 991, 44, 2648, 515, 197, 10957, 20646, 6184, 25, 5924, 5173, 756, 197, 197, 3608, 25, 260, 330, 2427, 756, 197, 30217, 915, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestEval(t *testing.T) { p1, err := NewPolynomial([]*big.Int{big.NewInt(10), big.NewInt(20), big.NewInt(30)}) assert.NilError(t, err) assert.DeepEqual(t, big.NewInt(10), p1.Eval(big.NewInt(0)), shtest.BigIntComparer) assert.DeepEqual(t, big.NewInt(10+20*10+30*100), p1.Eval(big.NewInt(10)), shtest.BigIntComparer) p2, err := NewPolynomial([]*big.Int{big.NewInt(0), new(big.Int).Sub(bn256.Order, big.NewInt(1))}) assert.NilError(t, err) assert.DeepEqual(t, big.NewInt(0), p2.Eval(big.NewInt(0)), shtest.BigIntComparer) assert.DeepEqual(t, new(big.Int).Sub(bn256.Order, big.NewInt(1)), p2.Eval(big.NewInt(1)), shtest.BigIntComparer) assert.DeepEqual(t, new(big.Int).Sub(bn256.Order, big.NewInt(2)), p2.Eval(big.NewInt(2)), shtest.BigIntComparer) p3, err := NewPolynomial([]*big.Int{big.NewInt(0), big.NewInt(1)}) assert.NilError(t, err) assert.DeepEqual(t, big.NewInt(0), p3.Eval(big.NewInt(0)), shtest.BigIntComparer) assert.DeepEqual(t, big.NewInt(0), p3.Eval(bn256.Order), shtest.BigIntComparer) assert.DeepEqual(t, big.NewInt(0), p3.Eval(new(big.Int).Mul(bn256.Order, big.NewInt(5))), shtest.BigIntComparer) }
explode_data.jsonl/60064
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 520 }
[ 2830, 3393, 54469, 1155, 353, 8840, 836, 8, 341, 3223, 16, 11, 1848, 1669, 1532, 14658, 25358, 85288, 16154, 7371, 90, 16154, 7121, 1072, 7, 16, 15, 701, 2409, 7121, 1072, 7, 17, 15, 701, 2409, 7121, 1072, 7, 18, 15, 59209, 6948, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestNative_Vsigned(t *testing.T) { var v types.JsonState i := 0 s := "1234" __vsigned(&s, &i, &v) assert.Equal(t, 4, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, int64(1234), v.Iv) assert.Equal(t, types.V_INTEGER, v.Vt) i = 0 s = "-1234" __vsigned(&s, &i, &v) assert.Equal(t, 5, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, int64(-1234), v.Iv) assert.Equal(t, types.V_INTEGER, v.Vt) i = 0 s = "9223372036854775807" __vsigned(&s, &i, &v) assert.Equal(t, 19, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, int64(math.MaxInt64), v.Iv) assert.Equal(t, types.V_INTEGER, v.Vt) i = 0 s = "-9223372036854775808" __vsigned(&s, &i, &v) assert.Equal(t, 20, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, int64(math.MinInt64), v.Iv) assert.Equal(t, types.V_INTEGER, v.Vt) i = 0 s = "9223372036854775808" __vsigned(&s, &i, &v) assert.Equal(t, 18, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INTEGER_OVERFLOW)), v.Vt) i = 0 s = "-9223372036854775809" __vsigned(&s, &i, &v) assert.Equal(t, 19, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INTEGER_OVERFLOW)), v.Vt) i = 0 s = "1.234" __vsigned(&s, &i, &v) assert.Equal(t, 1, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INVALID_NUMBER_FMT)), v.Vt) i = 0 s = "0.0125" __vsigned(&s, &i, &v) assert.Equal(t, 1, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INVALID_NUMBER_FMT)), v.Vt) i = 0 s = "-1234e5" __vsigned(&s, &i, &v) assert.Equal(t, 5, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INVALID_NUMBER_FMT)), v.Vt) i = 0 s = "-1234e-5" __vsigned(&s, &i, &v) assert.Equal(t, 5, i) assert.Equal(t, 0, v.Ep) assert.Equal(t, types.ValueType(-int(types.ERR_INVALID_NUMBER_FMT)), v.Vt) }
explode_data.jsonl/60920
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1123 }
[ 2830, 3393, 20800, 2334, 2215, 1155, 353, 8840, 836, 8, 341, 262, 762, 348, 4494, 13562, 1397, 198, 262, 600, 1669, 220, 15, 198, 262, 274, 1669, 330, 16, 17, 18, 19, 698, 262, 1304, 85, 2215, 2099, 82, 11, 609, 72, 11, 609, 85,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestWSUpgradeResponseWriteError(t *testing.T) { opts := testWSOptions() s := &Server{opts: opts} expectedErr := errors.New("on purpose") rw := &testResponseWriter{ conn: &testWSFakeNetConn{err: expectedErr}, } req := testWSCreateValidReq() res, err := s.wsUpgrade(rw, req) if err != expectedErr { t.Fatalf("Should get error %q, got %v", expectedErr.Error(), err) } if res != nil { t.Fatalf("Should not have returned a result, got %v", res) } if !rw.conn.isClosed { t.Fatal("Connection should have been closed") } }
explode_data.jsonl/42706
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 209 }
[ 2830, 3393, 7433, 43861, 2582, 7985, 1454, 1155, 353, 8840, 836, 8, 341, 64734, 1669, 1273, 7433, 3798, 741, 1903, 1669, 609, 5475, 90, 10518, 25, 12185, 532, 42400, 7747, 1669, 5975, 7121, 445, 263, 7428, 1138, 7000, 86, 1669, 609, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestCheckValue(t *testing.T) { testTxout.value = amount.Amount(util.MaxMoney) + 1 expectedError := errcode.NewError(errcode.RejectInvalid, "bad-txns-vout-toolarge") assert.Error(t, expectedError, testTxout.CheckValue().Error()) testTxout.value = amount.Amount(-1) expectedError = errcode.NewError(errcode.RejectInvalid, "bad-txns-vout-negative") assert.Error(t, expectedError, testTxout.CheckValue().Error()) }
explode_data.jsonl/38868
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 150 }
[ 2830, 3393, 3973, 1130, 1155, 353, 8840, 836, 8, 341, 18185, 31584, 411, 2824, 284, 3311, 62192, 67811, 14535, 24786, 8, 488, 220, 16, 198, 42400, 1454, 1669, 1848, 1851, 7121, 1454, 3964, 1851, 2817, 583, 7928, 11, 330, 13855, 2385, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestStoreSafeZAdd(t *testing.T) { st, closer := makeStore() defer closer() st.Set(schema.KeyValue{Key: []byte(`myFirstElementKey`), Value: []byte(`firstValue`)}) st.Set(schema.KeyValue{Key: []byte(`mySecondElementKey`), Value: []byte(`secondValue`)}) st.Set(schema.KeyValue{Key: []byte(`myThirdElementKey`), Value: []byte(`thirdValue`)}) safeZAddOptions1 := schema.SafeZAddOptions{ Zopts: &schema.ZAddOptions{ Set: []byte(`FirstSet`), Score: float64(43), Key: []byte(`mySecondElementKey`), }, } proof1, err := st.SafeZAdd(safeZAddOptions1) assert.NoError(t, err) assert.NotNil(t, proof1) assert.Equal(t, uint64(3), proof1.Index) key, _ := SetKey(safeZAddOptions1.Zopts.Key, safeZAddOptions1.Zopts.Set, safeZAddOptions1.Zopts.Score) leaf := api.Digest(proof1.Index, key, safeZAddOptions1.Zopts.Key) // Here verify if first reference was correctly inserted. We have no root yet. verified := proof1.Verify(leaf[:], schema.Root{}) assert.True(t, verified) root := schema.Root{ Index: proof1.Index, Root: proof1.Root, } safeZAddOptions2 := schema.SafeZAddOptions{ Zopts: &schema.ZAddOptions{ Set: []byte(`FirstSet`), Score: float64(43.548), Key: []byte(`myThirdElementKey`), }, RootIndex: &schema.Index{ Index: proof1.Index, }, } proof2, err2 := st.SafeZAdd(safeZAddOptions2) assert.NoError(t, err2) assert.NotNil(t, proof2) assert.Equal(t, uint64(4), proof2.Index) key2, _ := SetKey(safeZAddOptions2.Zopts.Key, safeZAddOptions2.Zopts.Set, safeZAddOptions2.Zopts.Score) leaf2 := api.Digest(proof2.Index, key2, safeZAddOptions2.Zopts.Key) // Here verify if first reference was correctly inserted. We have no root yet. verified2 := proof2.Verify(leaf2[:], root) assert.True(t, verified2) }
explode_data.jsonl/77972
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 730 }
[ 2830, 3393, 6093, 25663, 57, 2212, 1155, 353, 8840, 836, 8, 341, 18388, 11, 12128, 1669, 1281, 6093, 741, 16867, 12128, 2822, 18388, 4202, 42735, 9610, 1130, 90, 1592, 25, 3056, 3782, 5809, 2408, 5338, 1691, 1592, 63, 701, 5162, 25, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestAPIUserSearchLoggedIn(t *testing.T) { defer prepareTestEnv(t)() adminUsername := "user1" session := loginUser(t, adminUsername) token := getTokenForLoggedInUser(t, session) query := "user2" req := NewRequestf(t, "GET", "/api/v1/users/search?token=%s&q=%s", token, query) resp := session.MakeRequest(t, req, http.StatusOK) var results SearchResults DecodeJSON(t, resp, &results) assert.NotEmpty(t, results.Data) for _, user := range results.Data { assert.Contains(t, user.UserName, query) assert.NotEmpty(t, user.Email) } }
explode_data.jsonl/7508
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 210 }
[ 2830, 3393, 7082, 1474, 5890, 28559, 1155, 353, 8840, 836, 8, 341, 16867, 10549, 2271, 14359, 1155, 8, 741, 64394, 11115, 1669, 330, 872, 16, 698, 25054, 1669, 87169, 1155, 11, 3986, 11115, 340, 43947, 1669, 54111, 2461, 28559, 1474, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestPartitionWithSliceInt(t *testing.T) { fn := func(i int) bool { return i < 5 } under, over := Partition(fn, SLICE_INT) equals(t, 5, len(under)) equals(t, 5, len(over)) equals(t, 0, under[0]) equals(t, 5, over[0]) }
explode_data.jsonl/39417
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 107 }
[ 2830, 3393, 49978, 2354, 33236, 1072, 1155, 353, 8840, 836, 8, 1476, 40095, 1669, 2915, 1956, 526, 8, 1807, 341, 197, 853, 600, 366, 220, 20, 198, 197, 630, 197, 7995, 11, 916, 1669, 54626, 24008, 11, 16797, 5487, 9161, 692, 197, 71...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestReadVMXDir(t *testing.T) { var tests = []struct { dirname string version int expErr bool }{ {"valid", 11, false}, } _ = tests // for _, x := range tests { // } }
explode_data.jsonl/46911
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 79 }
[ 2830, 3393, 4418, 11187, 55, 6184, 1155, 353, 8840, 836, 8, 341, 2405, 7032, 284, 3056, 1235, 341, 197, 48532, 606, 914, 198, 197, 74954, 526, 198, 197, 48558, 7747, 220, 1807, 198, 197, 59403, 197, 197, 4913, 1891, 497, 220, 16, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestBaseIdentity_ToughGettersSetters(t *testing.T) { i := getTestBaseIdentity() if i.IsTough() { t.Error("IsTough should have return false, but it returned true") } i.ApplyTough() if !i.IsTough() { t.Error("Apply tough should have set tough to true, but it was false") } i.ClearTough() if i.IsTough() { t.Error("Clear tough should have set tough to false, but it was true") } }
explode_data.jsonl/55782
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 150 }
[ 2830, 3393, 3978, 18558, 1139, 1384, 1949, 5045, 1649, 5045, 1155, 353, 8840, 836, 8, 341, 8230, 1669, 633, 2271, 3978, 18558, 741, 743, 600, 4506, 51, 1384, 368, 341, 197, 3244, 6141, 445, 3872, 51, 1384, 1265, 614, 470, 895, 11, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestRetrieveWithAssetErrorConditions(t *testing.T) { t.Run("Invalid_AssetID", func(t *testing.T) { ctrl := gomock.NewController(t) mockAgent := mocks.NewMockAgent(ctrl) defer ctrl.Finish() mockAgent.EXPECT().QueryStream(gomock.Any(), gomock.Any()). Return(nil, helpers.ErrNotFound) mockRequest := httptest.NewRequest("GET", "/", nil) responseRecorder := httptest.NewRecorder() mockRequest = injectMockAssetContext(mockRequest, "T1", "C1", "A1", mockAgent, mocks.NewMockAssetSchemaAlwaysValid(ctrl)) handler := http.HandlerFunc(RetrieveAsset) handler.ServeHTTP(responseRecorder, mockRequest) assert.Equal(t, http.StatusNotFound, responseRecorder.Result().StatusCode, "Response Should be 404 NOT FOUND") }) }
explode_data.jsonl/65736
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 276 }
[ 2830, 3393, 87665, 2354, 16604, 1454, 35435, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 7928, 62741, 746, 915, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 84381, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 197, 77333, 16810, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestStatusPageResponseCodes(t *testing.T) { // req := httptest.NewRequest("GET", "/", nil) rr := httptest.NewRecorder() var chainDBStub ChainDBStub exp := New(&ExplorerConfig{ DataSource: &chainDBStub, UseRealIP: false, AppVersion: "test", DevPrefetch: false, Viewsfolder: viewsPath, XcBot: nil, Tracker: nil, AgendasSource: nil, Proposals: nil, PoliteiaURL: "", MainnetLink: "/", TestnetLink: "/", }) // handler := http.HandlerFunc() // handler.ServeHTTP(rr, req) io := []struct { ExpStatus expStatus RespCode int }{ { ExpStatusNotSupported, http.StatusUnprocessableEntity, }, } for _, oi := range io { exp.StatusPage(rr, "code", "msg", "junk", oi.ExpStatus) resp := rr.Result() if resp.StatusCode != oi.RespCode { t.Errorf("wrong code %d (%s), expected %d (%s)", resp.StatusCode, http.StatusText(resp.StatusCode), oi.RespCode, http.StatusText(oi.RespCode)) } } }
explode_data.jsonl/41369
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 427 }
[ 2830, 3393, 2522, 2665, 2582, 20871, 1155, 353, 8840, 836, 8, 341, 197, 322, 4232, 1669, 54320, 70334, 75274, 445, 3806, 497, 64657, 2092, 340, 197, 634, 1669, 54320, 70334, 7121, 47023, 2822, 2405, 8781, 3506, 33838, 28525, 3506, 33838, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestSimpleBoolean3(t *testing.T) { res, err := UnitTestEvalAndAST( `null == null`, nil, ` == null null `[1:]) if fmt.Sprint(res) != "true" || err != nil { t.Error(res, err) return } res, err = UnitTestEvalAndAST( `1 < 2 and 2 > 1`, nil, ` and < number: 1 number: 2 > number: 2 number: 1 `[1:]) if fmt.Sprint(res) != "true" || err != nil { t.Error(res, err) return } res, err = UnitTestEvalAndAST( `1 < 2 or 2 < 1`, nil, ` or < number: 1 number: 2 < number: 2 number: 1 `[1:]) if fmt.Sprint(res) != "true" || err != nil { t.Error(res, err) return } res, err = UnitTestEvalAndAST( `not (1 < 2 or 2 < 1)`, nil, ` not or < number: 1 number: 2 < number: 2 number: 1 `[1:]) if fmt.Sprint(res) != "false" || err != nil { t.Error(res, err) return } }
explode_data.jsonl/43154
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 442 }
[ 2830, 3393, 16374, 6890, 18, 1155, 353, 8840, 836, 8, 1476, 10202, 11, 1848, 1669, 7954, 2271, 54469, 3036, 6349, 1006, 197, 197, 63, 2921, 621, 845, 7808, 2092, 345, 197, 197, 3989, 20747, 220, 845, 198, 220, 845, 198, 63, 58, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
func TestCreateRegistrySaveError(t *testing.T) { mockRegistry := test.NewDeploymentConfigRegistry() mockRegistry.Err = fmt.Errorf("test error") storage := REST{registry: mockRegistry} channel, err := storage.Create(kapi.NewDefaultContext(), &api.DeploymentConfig{ ObjectMeta: kapi.ObjectMeta{Name: "foo"}, Template: api.DeploymentTemplate{ Strategy: deploytest.OkStrategy(), ControllerTemplate: deploytest.OkControllerTemplate(), }, }) if channel == nil { t.Errorf("Expected nil channel, got %v", channel) } if err != nil { t.Errorf("Unexpected non-nil error: %#v", err) } select { case result := <-channel: status, ok := result.Object.(*kapi.Status) if !ok { t.Errorf("Expected status type, got: %#v", result) } if status.Status != kapi.StatusFailure || status.Message != "test error" { t.Errorf("Expected failure status, got %#v", status) } case <-time.After(50 * time.Millisecond): t.Errorf("Timed out waiting for result") } }
explode_data.jsonl/66985
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 365 }
[ 2830, 3393, 4021, 15603, 8784, 1454, 1155, 353, 8840, 836, 8, 341, 77333, 15603, 1669, 1273, 7121, 75286, 2648, 15603, 741, 77333, 15603, 27862, 284, 8879, 13080, 445, 1944, 1465, 1138, 197, 16172, 1669, 25414, 90, 29172, 25, 7860, 15603,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
8
func TestStateRefreshFromTopo(t *testing.T) { ctx := context.Background() ts := memorytopo.NewServer("cell1") tm := newTestTM(t, ts, 1, "ks", "0") defer tm.Stop() err := tm.RefreshState(ctx) require.NoError(t, err) }
explode_data.jsonl/75586
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 93 }
[ 2830, 3393, 1397, 14567, 3830, 5366, 78, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 57441, 1669, 4938, 3481, 78, 7121, 5475, 445, 5873, 16, 1138, 3244, 76, 1669, 501, 2271, 22034, 1155, 11, 10591, 11, 220, 16, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestNonMatchedStaticRoute(t *testing.T) { dc, err := testdataclient.NewDoc(` a: Path("/foo/*_") -> "https://foo.org"; b: Path("/foo/bar") && CustomPredicate("custom1") -> "https://bar.org"; z: * -> "https://catch.all"`) if err != nil { t.Error(err) return } cps := []routing.PredicateSpec{&predicate{}} tr, err := newTestRoutingWithPredicates(cps, dc) if err != nil { t.Error(err) return } defer tr.close() req, err := http.NewRequest("GET", "https://www.example.com/foo/bar", nil) if err != nil { t.Error(err) return } if r, err := tr.checkRequest(req); r == nil || err != nil { t.Error(err) } else { if r.Backend != "https://foo.org" { t.Error("non-matched static route suppress wild-carded route") } } }
explode_data.jsonl/58580
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 318 }
[ 2830, 3393, 8121, 8331, 291, 11690, 4899, 1155, 353, 8840, 836, 8, 341, 87249, 11, 1848, 1669, 1273, 691, 2972, 7121, 9550, 61528, 197, 11323, 25, 7933, 4283, 7975, 1057, 62, 899, 1464, 330, 2428, 1110, 7975, 2659, 876, 197, 2233, 25,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
func TestPointCross(t *testing.T) { tests := []struct { p1x, p1y, p1z, p2x, p2y, p2z, norm float64 }{ {1, 0, 0, 1, 0, 0, 1}, {1, 0, 0, 0, 1, 0, 2}, {0, 1, 0, 1, 0, 0, 2}, {1, 2, 3, -4, 5, -6, 2 * math.Sqrt(934)}, } for _, test := range tests { p1 := Point{r3.Vector{test.p1x, test.p1y, test.p1z}} p2 := Point{r3.Vector{test.p2x, test.p2y, test.p2z}} result := p1.PointCross(p2) if !float64Eq(result.Norm(), test.norm) { t.Errorf("|%v ⨯ %v| = %v, want %v", p1, p2, result.Norm(), test.norm) } if x := result.Dot(p1.Vector); !float64Eq(x, 0) { t.Errorf("|(%v ⨯ %v) · %v| = %v, want 0", p1, p2, p1, x) } if x := result.Dot(p2.Vector); !float64Eq(x, 0) { t.Errorf("|(%v ⨯ %v) · %v| = %v, want 0", p1, p2, p2, x) } } }
explode_data.jsonl/52180
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 437 }
[ 2830, 3393, 2609, 28501, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 3223, 16, 87, 11, 281, 16, 88, 11, 281, 16, 89, 11, 281, 17, 87, 11, 281, 17, 88, 11, 281, 17, 89, 11, 7465, 2224, 21, 19, 198, 197, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestBindBinaryOp(t *testing.T) { env := environment(map[string]interface{}{ "a": NewOutputType(BoolType), "b": NewPromiseType(BoolType), "c": NewOutputType(NumberType), "d": NewPromiseType(NumberType), }) scope := env.scope() cases := []exprTestCase{ // Comparisons {x: "0 == 0", t: BoolType}, {x: "0 != 0", t: BoolType}, {x: "0 < 0", t: BoolType}, {x: "0 > 0", t: BoolType}, {x: "0 <= 0", t: BoolType}, {x: "0 >= 0", t: BoolType}, // Arithmetic {x: "0 + 0", t: NumberType}, {x: "0 - 0", t: NumberType}, {x: "0 * 0", t: NumberType}, {x: "0 / 0", t: NumberType}, {x: "0 % 0", t: NumberType}, // Logical {x: "false && false", t: BoolType}, {x: "false || false", t: BoolType}, // Lifted operations {x: "a == true", t: NewOutputType(BoolType)}, {x: "b == true", t: NewPromiseType(BoolType)}, {x: "c + 0", t: NewOutputType(NumberType)}, {x: "d + 0", t: NewPromiseType(NumberType)}, {x: "a && true", t: NewOutputType(BoolType)}, {x: "b && true", t: NewPromiseType(BoolType)}, } for _, c := range cases { t.Run(c.x, func(t *testing.T) { expr, diags := BindExpressionText(c.x, scope, hcl.Pos{}) assert.Len(t, diags, 0) assert.Equal(t, c.t, expr.Type()) _, ok := expr.(*BinaryOpExpression) assert.True(t, ok) assert.Equal(t, c.x, fmt.Sprintf("%v", expr)) }) } }
explode_data.jsonl/42563
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 633 }
[ 2830, 3393, 9950, 21338, 7125, 1155, 353, 8840, 836, 8, 341, 57538, 1669, 4573, 9147, 14032, 31344, 67066, 197, 197, 56693, 788, 1532, 5097, 929, 7, 11233, 929, 1326, 197, 197, 1, 65, 788, 1532, 21041, 929, 7, 11233, 929, 1326, 197, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func Test_ServiceDockerfileBuildRequired(t *testing.T) { testCases := map[string]struct { svc interface{} wanted bool wantedErr error }{ "invalid type": { svc: struct{}{}, wantedErr: fmt.Errorf("service does not have required methods BuildRequired()"), }, "fail to check": { svc: &LoadBalancedWebService{}, wantedErr: fmt.Errorf("check if service requires building from local Dockerfile: either \"image.build\" or \"image.location\" needs to be specified in the manifest"), }, "success with false": { svc: &LoadBalancedWebService{ LoadBalancedWebServiceConfig: LoadBalancedWebServiceConfig{ ImageConfig: ImageWithPortAndHealthcheck{ ImageWithPort: ImageWithPort{ Image: Image{ Location: aws.String("mockLocation"), }, }, }, }, }, }, "success with true": { svc: &LoadBalancedWebService{ LoadBalancedWebServiceConfig: LoadBalancedWebServiceConfig{ ImageConfig: ImageWithPortAndHealthcheck{ ImageWithPort: ImageWithPort{ Image: Image{ Build: BuildArgsOrString{ BuildString: aws.String("mockDockerfile"), }, }, }, }, }, }, wanted: true, }, } for name, tc := range testCases { t.Run(name, func(t *testing.T) { got, err := ServiceDockerfileBuildRequired(tc.svc) if tc.wantedErr != nil { require.EqualError(t, err, tc.wantedErr.Error()) } else { require.NoError(t, err) require.Equal(t, tc.wanted, got) } }) } }
explode_data.jsonl/70117
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 649 }
[ 2830, 3393, 52548, 35, 13659, 1192, 11066, 8164, 1155, 353, 8840, 836, 8, 341, 18185, 37302, 1669, 2415, 14032, 60, 1235, 341, 197, 1903, 7362, 3749, 31483, 197, 6692, 7566, 262, 1807, 198, 197, 6692, 7566, 7747, 1465, 198, 197, 59403, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestSpan_Attributes(t *testing.T) { ms := NewSpan() assert.EqualValues(t, NewMap(), ms.Attributes()) fillTestMap(ms.Attributes()) testValAttributes := generateTestMap() assert.EqualValues(t, testValAttributes, ms.Attributes()) }
explode_data.jsonl/63271
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 79 }
[ 2830, 3393, 12485, 55581, 3604, 1155, 353, 8840, 836, 8, 341, 47691, 1669, 1532, 12485, 741, 6948, 12808, 6227, 1155, 11, 1532, 2227, 1507, 9829, 31384, 2398, 65848, 2271, 2227, 35680, 31384, 2398, 18185, 2208, 10516, 1669, 6923, 2271, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestBufferEqual(t *testing.T) { tt := []struct { a, b RuneArray ok bool }{ {RuneArray(nil), RuneArray(nil), true}, {RuneArray(nil), RuneArray([]rune{}), true}, {RuneArray([]rune{}), RuneArray(nil), true}, {RuneArray([]rune("01234")), RuneArray([]rune("01234")), true}, {RuneArray([]rune("01234")), RuneArray([]rune("01x34")), false}, {RuneArray([]rune("αβγ")), RuneArray([]rune("αβγ")), true}, {RuneArray([]rune("αβγ")), RuneArray([]rune("αλγ")), false}, } for _, tc := range tt { ok := tc.a.Equal(tc.b) if ok != tc.ok { t.Errorf("Equal(%v) for buffer %v returned %v; expected %v", tc.b, tc.a, ok, tc.ok) } } }
explode_data.jsonl/37933
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 313 }
[ 2830, 3393, 4095, 2993, 1155, 353, 8840, 836, 8, 341, 3244, 83, 1669, 3056, 1235, 341, 197, 11323, 11, 293, 70778, 1857, 198, 197, 59268, 256, 1807, 198, 197, 59403, 197, 197, 90, 49, 2886, 1857, 27907, 701, 70778, 1857, 27907, 701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestAzureMachine_ValidateCreate(t *testing.T) { g := NewWithT(t) tests := []struct { name string machine *AzureMachine wantErr bool }{ { name: "azuremachine with marketplace image - full", machine: createMachineWithtMarketPlaceImage(t, "PUB1234", "OFFER1234", "SKU1234", "1.0.0"), wantErr: false, }, { name: "azuremachine with marketplace image - missing publisher", machine: createMachineWithtMarketPlaceImage(t, "", "OFFER1234", "SKU1234", "1.0.0"), wantErr: true, }, { name: "azuremachine with shared gallery image - full", machine: createMachineWithSharedImage(t, "SUB123", "RG123", "NAME123", "GALLERY1", "1.0.0"), wantErr: false, }, { name: "azuremachine with marketplace image - missing subscription", machine: createMachineWithSharedImage(t, "", "RG123", "NAME123", "GALLERY1", "1.0.0"), wantErr: true, }, { name: "azuremachine with image by - with id", machine: createMachineWithImageByID(t, "ID123"), wantErr: false, }, { name: "azuremachine with image by - without id", machine: createMachineWithImageByID(t, ""), wantErr: true, }, { name: "azuremachine with valid SSHPublicKey", machine: createMachineWithSSHPublicKey(t, validSSHPublicKey), wantErr: false, }, { name: "azuremachine without SSHPublicKey", machine: createMachineWithSSHPublicKey(t, ""), wantErr: true, }, { name: "azuremachine with invalid SSHPublicKey", machine: createMachineWithSSHPublicKey(t, "invalid ssh key"), wantErr: true, }, { name: "azuremachine with list of user-assigned identities", machine: createMachineWithUserAssignedIdentities(t, []UserAssignedIdentity{{ProviderID: "azure:///123"}, {ProviderID: "azure:///456"}}), wantErr: false, }, { name: "azuremachine with empty list of user-assigned identities", machine: createMachineWithUserAssignedIdentities(t, []UserAssignedIdentity{}), wantErr: true, }, { name: "azuremachine with valid osDisk cache type", machine: createMachineWithOsDiskCacheType(t, string(compute.PossibleCachingTypesValues()[1])), wantErr: false, }, { name: "azuremachine with invalid osDisk cache type", machine: createMachineWithOsDiskCacheType(t, "invalid_cache_type"), wantErr: true, }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { err := tc.machine.ValidateCreate() if tc.wantErr { g.Expect(err).To(HaveOccurred()) } else { g.Expect(err).NotTo(HaveOccurred()) } }) } }
explode_data.jsonl/24641
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1057 }
[ 2830, 3393, 78107, 21605, 62, 17926, 4021, 1155, 353, 8840, 836, 8, 341, 3174, 1669, 1532, 2354, 51, 1155, 692, 78216, 1669, 3056, 1235, 341, 197, 11609, 262, 914, 198, 197, 2109, 3814, 353, 78107, 21605, 198, 197, 50780, 7747, 1807, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestApixu_CloseResponseBodyError(t *testing.T) { a := &apixu{ config: Config{}, httpClient: &httpClientMock{ response: &http.Response{ StatusCode: http.StatusOK, Body: &bodyMock{ closeErr: errors.New("error"), }, }, err: nil, }, read: func(r io.Reader) ([]byte, error) { return []byte{}, nil }, } res, err := a.Search("query") assert.Nil(t, res) assert.Error(t, err) }
explode_data.jsonl/14949
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 193 }
[ 2830, 3393, 10611, 941, 84, 68185, 29637, 1454, 1155, 353, 8840, 836, 8, 341, 11323, 1669, 609, 391, 941, 84, 515, 197, 25873, 25, 5532, 38837, 197, 28080, 2959, 25, 609, 83417, 11571, 515, 298, 21735, 25, 609, 1254, 12574, 515, 571, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestBuildInventory(t *testing.T) { defer monkeyPatchGopherCloudAuth().Unpatch() defer monkeyPatchGopherCloudComputeClient().Unpatch() defer monkeyPatchImageFetching().Unpatch() defer monkeyPatchServerFetching().Unpatch() clouds := fakeClouds() errs := clouds.Refresh() assert.Empty(t, errs) bytes, err := clouds.BuildInventory("production") assert.NoError(t, err) expected := ` { "_meta": { "hostvars": { "0f47385f-2be6-426c-b45f-5b05db68dd11": { "ansible_host": "130.155.5.7", "ansible_user": "core", "provider": "acme", "region_group": "eu-east", "region_label": "EasternCity", "region_name": "east-1", "tls": "true" }, "f9c33aae-e54a-4ca7-96f8-167f990fd75e": { "ansible_host": "481b:a820:6afip1:fa86:b904:88d9:9a0b:9faf", "ansible_user": "admin", "provider": "acme", "region_group": "eu-east", "region_label": "EasternCity", "region_name": "east-1", "tls": "true" } } }, "acme": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "acme_hardened": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "acme_web": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "east-1": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "east-1_hardened": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "east-1_web": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "eu-east": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "eu-east_hardened": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "eu-east_web": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "hardened": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ], "web": [ "0f47385f-2be6-426c-b45f-5b05db68dd11", "f9c33aae-e54a-4ca7-96f8-167f990fd75e" ] }` assert.JSONEq(t, expected, string(bytes)) }
explode_data.jsonl/57474
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1269 }
[ 2830, 3393, 11066, 22319, 1155, 353, 8840, 836, 8, 341, 16867, 38703, 43622, 38, 16940, 16055, 5087, 1005, 1806, 3400, 741, 16867, 38703, 43622, 38, 16940, 16055, 46254, 2959, 1005, 1806, 3400, 741, 16867, 38703, 43622, 1906, 52416, 1005, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestService_ListSoftware(t *testing.T) { ds := new(mock.Store) var calledWithTeamID *uint var calledWithOpt fleet.SoftwareListOptions ds.ListSoftwareFunc = func(ctx context.Context, opt fleet.SoftwareListOptions) ([]fleet.Software, error) { calledWithTeamID = opt.TeamID calledWithOpt = opt return []fleet.Software{}, nil } user := &fleet.User{ID: 3, Email: "foo@bar.com", GlobalRole: ptr.String(fleet.RoleObserver)} svc := newTestService(ds, nil, nil) ctx := context.Background() ctx = viewer.NewContext(ctx, viewer.Viewer{User: user}) _, err := svc.ListSoftware(ctx, fleet.SoftwareListOptions{TeamID: ptr.Uint(42), ListOptions: fleet.ListOptions{PerPage: 77, Page: 4}}) require.NoError(t, err) assert.True(t, ds.ListSoftwareFuncInvoked) assert.Equal(t, ptr.Uint(42), calledWithTeamID) assert.Equal(t, fleet.ListOptions{PerPage: 77, Page: 4}, calledWithOpt.ListOptions) }
explode_data.jsonl/14978
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 319 }
[ 2830, 3393, 1860, 27104, 19250, 1155, 353, 8840, 836, 8, 341, 83336, 1669, 501, 30389, 38047, 692, 2405, 2598, 2354, 14597, 915, 353, 2496, 198, 2405, 2598, 2354, 21367, 25099, 46387, 2110, 852, 3798, 198, 83336, 5814, 19250, 9626, 284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestAESCBCBuilder(t *testing.T) { generator := mockGenerator{} builder := s3crypto.AESCBCContentCipherBuilder(generator, s3crypto.NoPadder) if builder == nil { t.Fatal(builder) } _, err := builder.ContentCipher() if err != nil { t.Fatal(err) } }
explode_data.jsonl/25580
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 107 }
[ 2830, 3393, 32, 53714, 4897, 3297, 1155, 353, 8840, 836, 8, 341, 3174, 15312, 1669, 7860, 12561, 16094, 44546, 1669, 274, 18, 35772, 875, 53714, 4897, 2762, 79460, 3297, 58053, 11, 274, 18, 35772, 16766, 47, 20808, 340, 743, 7363, 621, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestAllHandlers(t *testing.T) { h := &TestPrintHandler{numCalls: 0} AddHandlers(h) if h.getNumCalls() == 0 { t.Error("TableHandler not called in AddHandlers") } }
explode_data.jsonl/21581
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 70 }
[ 2830, 3393, 2403, 39949, 1155, 353, 8840, 836, 8, 341, 9598, 1669, 609, 2271, 8994, 3050, 90, 2413, 55292, 25, 220, 15, 532, 37972, 39949, 3203, 340, 743, 305, 68963, 55292, 368, 621, 220, 15, 341, 197, 3244, 6141, 445, 2556, 3050, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
func TestDirect_SyncAdd(t *testing.T) { g := NewGomegaWithT(t) xform, src, acc := setup(g) xform.Start() defer xform.Stop() src.Handlers.Handle(event.FullSyncFor(basicmeta.K8SCollection1)) src.Handlers.Handle(event.AddFor(basicmeta.K8SCollection1, data.EntryN1I1V1)) fixtures.ExpectEventsEventually(t, acc, event.FullSyncFor(basicmeta.Collection2), event.AddFor(basicmeta.Collection2, data.EntryN1I1V1)) // XForm to Collection2 }
explode_data.jsonl/37555
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 174 }
[ 2830, 3393, 16027, 1098, 1721, 2212, 1155, 353, 8840, 836, 8, 341, 3174, 1669, 1532, 38, 32696, 2354, 51, 1155, 692, 10225, 627, 11, 2286, 11, 1029, 1669, 6505, 3268, 692, 10225, 627, 12101, 741, 16867, 856, 627, 30213, 2822, 41144, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGocloak_GetRealmRolesByGroupID(t *testing.T) { t.Parallel() cfg := GetConfig(t) client := NewClientWithDebug(t) token := GetAdminToken(t, client) tearDown, groupID := CreateGroup(t, client) defer tearDown() _, err := client.GetRealmRolesByGroupID( token.AccessToken, cfg.GoCloak.Realm, groupID) FailIfErr(t, err, "GetRealmRolesByGroupID failed") }
explode_data.jsonl/79550
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 152 }
[ 2830, 3393, 38, 509, 385, 585, 13614, 64290, 25116, 1359, 2808, 915, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 50286, 1669, 2126, 2648, 1155, 340, 25291, 1669, 1532, 2959, 2354, 7939, 1155, 340, 43947, 1669, 2126, 7210, 3323...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestMove(t *testing.T) { gtest.C(t, func(t *gtest.T) { l := New() e1 := l.PushBack(1) e2 := l.PushBack(2) e3 := l.PushBack(3) e4 := l.PushBack(4) l.MoveAfter(e3, e3) checkListPointers(t, l, []*Element{e1, e2, e3, e4}) l.MoveBefore(e2, e2) checkListPointers(t, l, []*Element{e1, e2, e3, e4}) l.MoveAfter(e3, e2) checkListPointers(t, l, []*Element{e1, e2, e3, e4}) l.MoveBefore(e2, e3) checkListPointers(t, l, []*Element{e1, e2, e3, e4}) l.MoveBefore(e2, e4) checkListPointers(t, l, []*Element{e1, e3, e2, e4}) e2, e3 = e3, e2 l.MoveBefore(e4, e1) checkListPointers(t, l, []*Element{e4, e1, e2, e3}) e1, e2, e3, e4 = e4, e1, e2, e3 l.MoveAfter(e4, e1) checkListPointers(t, l, []*Element{e1, e4, e2, e3}) e2, e3, e4 = e4, e2, e3 l.MoveAfter(e2, e3) checkListPointers(t, l, []*Element{e1, e3, e2, e4}) e2, e3 = e3, e2 }) }
explode_data.jsonl/30891
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 504 }
[ 2830, 3393, 9860, 1155, 353, 8840, 836, 8, 341, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 8810, 1669, 1532, 741, 197, 7727, 16, 1669, 326, 34981, 3707, 7, 16, 340, 197, 7727, 17, 1669, 326, 34981, 3707, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGetHeadersForRoute(t *testing.T) { assert := tassert.New(t) userAgentHeader := "user-agent" // Returns a list of HeaderMatcher for a route routePolicy := trafficpolicy.HTTPRouteMatch{ Path: "/books-bought", PathMatchType: trafficpolicy.PathMatchRegex, Methods: []string{"GET", "POST"}, Headers: map[string]string{ userAgentHeader: "This is a test header", }, } actual := getHeadersForRoute(routePolicy.Methods[0], routePolicy.Headers) assert.Equal(2, len(actual)) assert.Equal(methodHeaderKey, actual[0].Name) assert.Equal(routePolicy.Methods[0], actual[0].GetSafeRegexMatch().Regex) assert.Equal(userAgentHeader, actual[1].Name) assert.Equal(routePolicy.Headers[userAgentHeader], actual[1].GetSafeRegexMatch().Regex) // Returns only one HeaderMatcher for a route routePolicy = trafficpolicy.HTTPRouteMatch{ Path: "/books-bought", PathMatchType: trafficpolicy.PathMatchRegex, Methods: []string{"GET", "POST"}, } actual = getHeadersForRoute(routePolicy.Methods[1], routePolicy.Headers) assert.Equal(1, len(actual)) assert.Equal(methodHeaderKey, actual[0].Name) assert.Equal(routePolicy.Methods[1], actual[0].GetSafeRegexMatch().Regex) // Returns only HeaderMatcher for the method and host header (:authority) routePolicy = trafficpolicy.HTTPRouteMatch{ Path: "/books-bought", PathMatchType: trafficpolicy.PathMatchRegex, Methods: []string{"GET", "POST"}, Headers: map[string]string{ "host": tests.HTTPHostHeader, }, } actual = getHeadersForRoute(routePolicy.Methods[0], routePolicy.Headers) assert.Equal(2, len(actual)) assert.Equal(methodHeaderKey, actual[0].Name) assert.Equal(routePolicy.Methods[0], actual[0].GetSafeRegexMatch().Regex) assert.Equal(authorityHeaderKey, actual[1].Name) assert.Equal(tests.HTTPHostHeader, actual[1].GetSafeRegexMatch().Regex) }
explode_data.jsonl/75520
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 687 }
[ 2830, 3393, 1949, 10574, 2461, 4899, 1155, 353, 8840, 836, 8, 341, 6948, 1669, 259, 2207, 7121, 1155, 692, 19060, 16810, 4047, 1669, 330, 872, 41935, 1837, 197, 322, 5184, 264, 1140, 315, 12104, 37554, 369, 264, 6021, 198, 7000, 2133, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestMWFunc(t *testing.T) { cases := map[string]struct { wantStatus int header string signMethod string }{ "Empty header": { wantStatus: http.StatusUnauthorized, }, "Success": { header: "Bearer 123", wantStatus: http.StatusOK, }, } ts := httptest.NewServer(echoHandler(auth.Middleware(tokenParser{}))) defer ts.Close() path := ts.URL + "/hello" client := &http.Client{} for name, tt := range cases { t.Run(name, func(t *testing.T) { req, _ := http.NewRequest("GET", path, nil) req.Header.Set("Authorization", tt.header) res, err := client.Do(req) if err != nil { t.Fatal("Cannot create http request") } assert.Equal(t, tt.wantStatus, res.StatusCode) }) } }
explode_data.jsonl/26134
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 309 }
[ 2830, 3393, 54173, 9626, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 2415, 14032, 60, 1235, 341, 197, 50780, 2522, 526, 198, 197, 20883, 257, 914, 198, 197, 69054, 3523, 914, 198, 197, 59403, 197, 197, 1, 3522, 4247, 788, 341, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestLoggerLevelsActivateSpec(t *testing.T) { var tests = []struct { spec string expectedLevels map[string]zapcore.Level expectedDefaultLevel zapcore.Level }{ { spec: "DEBUG", expectedLevels: map[string]zapcore.Level{}, expectedDefaultLevel: zapcore.DebugLevel, }, { spec: "INFO", expectedLevels: map[string]zapcore.Level{}, expectedDefaultLevel: zapcore.InfoLevel, }, { spec: "logger=info:DEBUG", expectedLevels: map[string]zapcore.Level{ "logger": zapcore.InfoLevel, "logger.a": zapcore.InfoLevel, "logger.b": zapcore.InfoLevel, "logger.a.b": zapcore.InfoLevel, }, expectedDefaultLevel: zapcore.DebugLevel, }, { spec: "logger=info:logger.=error:DEBUG", expectedLevels: map[string]zapcore.Level{ "logger": zapcore.ErrorLevel, "logger.a": zapcore.InfoLevel, "logger.b": zapcore.InfoLevel, "logger.a.b": zapcore.InfoLevel, }, expectedDefaultLevel: zapcore.DebugLevel, }, { spec: "logger.a,logger.b=info:logger.c=WARN:DEBUG", expectedLevels: map[string]zapcore.Level{ "logger.a": zapcore.InfoLevel, "logger.b": zapcore.InfoLevel, "logger.c": zapcore.WarnLevel, }, expectedDefaultLevel: zapcore.DebugLevel, }, { spec: "a.b=info:a,z=error:c.b=info:c.=warn:debug", expectedLevels: map[string]zapcore.Level{ "a": zapcore.ErrorLevel, "z": zapcore.ErrorLevel, "a.b": zapcore.InfoLevel, "a.b.c": zapcore.InfoLevel, "a.b.c.d": zapcore.InfoLevel, "a.c": zapcore.ErrorLevel, "c": zapcore.WarnLevel, "c.a": zapcore.DebugLevel, "c.b": zapcore.InfoLevel, "d": zapcore.DebugLevel, "ab.c": zapcore.DebugLevel, "c.b.a": zapcore.InfoLevel, "c.b.a.b": zapcore.InfoLevel, }, expectedDefaultLevel: zapcore.DebugLevel, }, { spec: "info:warn", expectedLevels: map[string]zapcore.Level{ "a": zapcore.WarnLevel, "a.b": zapcore.WarnLevel, "b": zapcore.WarnLevel, "c": zapcore.WarnLevel, "d": zapcore.WarnLevel, }, expectedDefaultLevel: zapcore.WarnLevel, }, } for _, tc := range tests { t.Run(tc.spec, func(t *testing.T) { ll := &flogging.LoggerLevels{} err := ll.ActivateSpec(tc.spec) assert.NoError(t, err) assert.Equal(t, tc.expectedDefaultLevel, ll.DefaultLevel()) for name, lvl := range tc.expectedLevels { assert.Equal(t, lvl, ll.Level(name)) } }) } }
explode_data.jsonl/81863
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1291 }
[ 2830, 3393, 7395, 46991, 31242, 8327, 1155, 353, 8840, 836, 8, 341, 2405, 7032, 284, 3056, 1235, 341, 197, 98100, 338, 914, 198, 197, 42400, 46991, 981, 2415, 14032, 60, 92371, 2153, 25259, 198, 197, 42400, 3675, 4449, 32978, 2153, 2525...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestGetAllOrcidAttributesBadToken(t *testing.T) { expected := http.StatusForbidden status, _ := client.GetAllOrcidAttributes(cfg.Endpoint, badToken(cfg.Secret)) if status != expected { t.Fatalf("Expected %v, got %v\n", expected, status) } }
explode_data.jsonl/4714
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 89 }
[ 2830, 3393, 1949, 2403, 46, 1287, 307, 10516, 17082, 3323, 1155, 353, 8840, 836, 8, 341, 42400, 1669, 1758, 10538, 69115, 198, 23847, 11, 716, 1669, 2943, 45732, 46, 1287, 307, 10516, 28272, 90409, 11, 3873, 3323, 28272, 74779, 1171, 74...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestNewGrpcClient_EtcdFails(t *testing.T) { controller := gomock.NewController(t) oldGrpcDialContext := grpc.DialContext mockDialer := mock_grpc.NewMockDialer(controller) mockKV := mock_etcd.NewMockKV(controller) grpcDialContext = mockDialer.DialContext defer func() { grpcDialContext = oldGrpcDialContext }() ctx := context.TODO() mockKV.EXPECT().Get(ctx, "/ns/service/test", gomock.Any()).Return( nil, errors.New("etcd is sad")) conn, err := NewGrpcClient(ctx, mockKV, "test") if err == nil { t.Error("NewGrpcClient succeeds despite etcd errors?") } if conn != nil { t.Error("Received non-nil connection") } }
explode_data.jsonl/11503
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 246 }
[ 2830, 3393, 3564, 6464, 3992, 2959, 2089, 83, 4385, 37, 6209, 1155, 353, 8840, 836, 8, 341, 61615, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 61828, 6464, 3992, 35, 530, 1972, 1669, 47900, 98462, 1972, 198, 77333, 35, 530, 261, 1669...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestWriteAndCommitConfig(t *testing.T) { // Reset global variables to start afresh. resetTestGlobals() rootPath, err := newTestConfig("us-east-1") if err != nil { t.Fatalf("Unable to initialize server config. %s", err) } defer os.RemoveAll(rootPath) adminServer := adminCmd{} creds := globalServerConfig.GetCredential() token, err := authenticateNode(creds.AccessKey, creds.SecretKey) if err != nil { t.Fatal(err) } args := LoginRPCArgs{ AuthToken: token, Version: globalRPCAPIVersion, RequestTime: UTCNow(), } reply := LoginRPCReply{} err = adminServer.Login(&args, &reply) if err != nil { t.Fatalf("Failed to login to admin server - %v", err) } // Write temporary config. buf := []byte("hello") tmpFileName := mustGetUUID() wArgs := WriteConfigArgs{ AuthRPCArgs: AuthRPCArgs{ AuthToken: token, Version: globalRPCAPIVersion, }, TmpFileName: tmpFileName, Buf: buf, } err = adminServer.WriteTmpConfig(&wArgs, &WriteConfigReply{}) if err != nil { t.Fatalf("Failed to write temporary config %v", err) } if err != nil { t.Errorf("Expected to succeed but failed %v", err) } cArgs := CommitConfigArgs{ AuthRPCArgs: AuthRPCArgs{ AuthToken: token, Version: globalRPCAPIVersion, }, FileName: tmpFileName, } cReply := CommitConfigReply{} err = adminServer.CommitConfig(&cArgs, &cReply) if err != nil { t.Fatalf("Failed to commit config file %v", err) } }
explode_data.jsonl/5193
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 571 }
[ 2830, 3393, 7985, 3036, 33441, 2648, 1155, 353, 8840, 836, 8, 341, 197, 322, 16932, 3644, 7332, 311, 1191, 7977, 2488, 624, 70343, 2271, 48592, 2822, 33698, 1820, 11, 1848, 1669, 501, 2271, 2648, 445, 355, 39507, 12, 16, 1138, 743, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
func TestCreateObjectOK(t *testing.T) { testServer(func(s *core.Server) { //test create score := getGameScore(1001, "adnaan", t) headers := make(map[string]string) headers["X-Api-Token"] = apiToken headers["X-Api-Secret"] = apiSecret url := "/api/v1/objects/" + "GameScore" //make request res, err := testHTTPRequestWithHeaders("POST", url, string(score), headers) if err != nil { t.Fatalf("unable to create object: %v , %v", url, err) } else { body, _ := ioutil.ReadAll(res.Body) if res.StatusCode != 200 { t.Fatalf("unable to create object: %v , %v", url, string(body)) } //fmt.Printf("create object response: %v \n", string(body)) var response map[string]interface{} err := json.Unmarshal(body, &response) if err != nil { t.Fatalf("fail to parse body: %v", string(body)) } objectID = response["objectID"].(string) } }) }
explode_data.jsonl/42216
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 362 }
[ 2830, 3393, 4021, 1190, 3925, 1155, 353, 8840, 836, 8, 1476, 18185, 5475, 18552, 1141, 353, 2153, 22997, 8, 341, 197, 197, 322, 1944, 1855, 198, 197, 60425, 1669, 633, 4868, 10570, 7, 16, 15, 15, 16, 11, 330, 329, 3376, 276, 497, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestVisitor(t *testing.T) { for _, tt := range nodesToTest { v := &visitorMock{true, []string{}} tt.node.Walk(v) expected := tt.expectedVisitedKeys actual := v.visitedKeys assert.DeepEqual(t, expected, actual) } }
explode_data.jsonl/50810
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 95 }
[ 2830, 3393, 16796, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 17853, 1669, 2088, 7798, 1249, 2271, 341, 197, 5195, 1669, 609, 39985, 11571, 90, 1866, 11, 3056, 917, 6257, 532, 197, 3244, 83, 12097, 1175, 1692, 3747, 692, 197, 42400, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestPeerIdGetterAndSetter(t *testing.T) { tf.UnitTest(t) t.Run("successfully retrieves and updates peer ID", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() st, vms := core.CreateStorages(ctx, t) origPid := th.RequireRandomPeerID(t) minerAddr := createTestMiner(t, st, vms, address.TestAddress, []byte("my public key"), origPid) // retrieve peer ID resultA := callQueryMethodSuccess("getPeerID", ctx, t, st, vms, address.TestAddress, minerAddr) pid, err := peer.IDFromBytes(resultA[0]) require.NoError(t, err) require.Equal(t, peer.IDB58Encode(origPid), peer.IDB58Encode(pid)) // update peer ID newPid := th.RequireRandomPeerID(t) updatePeerIdSuccess(ctx, t, st, vms, address.TestAddress, minerAddr, newPid) // retrieve peer ID resultB := callQueryMethodSuccess("getPeerID", ctx, t, st, vms, address.TestAddress, minerAddr) pid, err = peer.IDFromBytes(resultB[0]) require.NoError(t, err) require.Equal(t, peer.IDB58Encode(newPid), peer.IDB58Encode(pid)) }) t.Run("authorization failure while updating peer ID", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() st, vms := core.CreateStorages(ctx, t) minerAddr := createTestMiner(t, st, vms, address.TestAddress, []byte("other public key"), th.RequireRandomPeerID(t)) // update peer ID and expect authorization failure (TestAddress2 doesn't owner miner) updatePeerIdMsg := types.NewMessage( address.TestAddress2, minerAddr, core.MustGetNonce(st, address.TestAddress2), types.NewAttoFILFromFIL(0), "updatePeerID", actor.MustConvertParams(th.RequireRandomPeerID(t))) applyMsgResult, err := th.ApplyTestMessage(st, vms, updatePeerIdMsg, types.NewBlockHeight(0)) require.NoError(t, err) require.Equal(t, Errors[ErrCallerUnauthorized], applyMsgResult.ExecutionError) require.NotEqual(t, uint8(0), applyMsgResult.Receipt.ExitCode) }) }
explode_data.jsonl/55765
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 750 }
[ 2830, 3393, 30888, 764, 31485, 3036, 44294, 1155, 353, 8840, 836, 8, 341, 3244, 69, 25159, 2271, 1155, 692, 3244, 16708, 445, 60505, 70671, 323, 8837, 14397, 3034, 497, 2915, 1155, 353, 8840, 836, 8, 1476, 197, 20985, 11, 9121, 1669, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestInitializeRemoteStorageCreateLocalDirs(t *testing.T) { require.NoError(t, os.MkdirAll("data", 0777)) defer os.RemoveAll("data") s := DefaultServer() m := memory.Open() storeData(t, m, "dir1/file1", []byte{1, 2, 3}) storeData(t, m, "dir1/file2", []byte{1, 2, 3}) storeData(t, m, "dir2/file3", []byte{1, 2, 3}) storeData(t, m, "dir3/file4", []byte{1, 2, 3}) err := s.initializeRemoteStorage(m) require.NoError(t, err) require.DirExists(t, "./data/dir1") require.DirExists(t, "./data/dir2") require.DirExists(t, "./data/dir3") }
explode_data.jsonl/38342
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 242 }
[ 2830, 3393, 9928, 24703, 5793, 4021, 7319, 97384, 1155, 353, 8840, 836, 8, 341, 17957, 35699, 1155, 11, 2643, 1321, 12438, 2403, 445, 691, 497, 220, 15, 22, 22, 22, 1171, 16867, 2643, 84427, 445, 691, 5130, 1903, 1669, 7899, 5475, 741...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestSummaryDataPointSlice(t *testing.T) { es := NewSummaryDataPointSlice() assert.EqualValues(t, 0, es.Len()) es = newSummaryDataPointSlice(&[]*otlpmetrics.SummaryDataPoint{}) assert.EqualValues(t, 0, es.Len()) es.EnsureCapacity(7) emptyVal := newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}) testVal := generateTestSummaryDataPoint() assert.EqualValues(t, 7, cap(*es.orig)) for i := 0; i < es.Len(); i++ { el := es.AppendEmpty() assert.EqualValues(t, emptyVal, el) fillTestSummaryDataPoint(el) assert.EqualValues(t, testVal, el) } }
explode_data.jsonl/32742
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 216 }
[ 2830, 3393, 19237, 1043, 2609, 33236, 1155, 353, 8840, 836, 8, 341, 78966, 1669, 1532, 19237, 1043, 2609, 33236, 741, 6948, 12808, 6227, 1155, 11, 220, 15, 11, 1531, 65819, 2398, 78966, 284, 501, 19237, 1043, 2609, 33236, 2099, 1294, 9,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestCloudRun_Write(t *testing.T) { cr := defaultCloudrun() tests := []struct { name string metrics []telegraf.Metric wantErr bool }{ {"success", testutil.MockMetrics(), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // TODO: Common pattern tt.plugin.SetSerializer(serializer) seen in other output tests // Is it a better approach? I think it would resolve the nil pointer dereference I'm getting serializer := influx.NewSerializer() cr.serializer = serializer if err := cr.Write(tt.metrics); (err != nil) != tt.wantErr { t.Errorf("Write() error = %v, wantErr %v", err, tt.wantErr) } }) } }
explode_data.jsonl/4959
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 261 }
[ 2830, 3393, 16055, 6727, 31825, 1155, 353, 8840, 836, 8, 341, 91492, 1669, 1638, 16055, 6108, 2822, 78216, 1669, 3056, 1235, 341, 197, 11609, 262, 914, 198, 197, 2109, 13468, 3056, 15410, 76039, 1321, 16340, 198, 197, 50780, 7747, 1807, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestFilter_LoadWordDict(t *testing.T) { type fields struct { trie *Trie noise *regexp.Regexp } type args struct { path string } tests := []struct { name string fields fields args args wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { filter := &Filter{ trie: tt.fields.trie, noise: tt.fields.noise, } if err := filter.LoadWordDict(tt.args.path); (err != nil) != tt.wantErr { t.Errorf("Filter.LoadWordDict() error = %v, wantErr %v", err, tt.wantErr) } }) } }
explode_data.jsonl/81000
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 276 }
[ 2830, 3393, 5632, 19553, 10879, 13448, 1155, 353, 8840, 836, 8, 341, 13158, 5043, 2036, 341, 197, 197, 8927, 220, 353, 51, 7231, 198, 197, 197, 52218, 353, 55796, 8989, 4580, 198, 197, 532, 13158, 2827, 2036, 341, 197, 26781, 914, 198...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestClone_NoReclone(t *testing.T) { repoDir, _ := initRepo(t) dataDir, cleanup2 := TempDir(t) defer cleanup2() runCmd(t, dataDir, "mkdir", "-p", "repos/0/") runCmd(t, dataDir, "mv", repoDir, "repos/0/default") // Create a file that we can use later to check if the repo was recloned. runCmd(t, dataDir, "touch", "repos/0/default/proof") wd := &events.FileWorkspace{ DataDir: dataDir, CheckoutMerge: false, TestingOverrideHeadCloneURL: fmt.Sprintf("file://%s", repoDir), } cloneDir, err := wd.Clone(nil, models.Repo{}, models.Repo{}, models.PullRequest{ HeadBranch: "branch", }, "default") Ok(t, err) // Check that our proof file is still there. _, err = os.Stat(filepath.Join(cloneDir, "proof")) Ok(t, err) }
explode_data.jsonl/17061
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 332 }
[ 2830, 3393, 37677, 36989, 693, 19982, 1155, 353, 8840, 836, 8, 341, 17200, 5368, 6184, 11, 716, 1669, 2930, 25243, 1155, 340, 8924, 6184, 11, 21290, 17, 1669, 19944, 6184, 1155, 340, 16867, 21290, 17, 2822, 56742, 15613, 1155, 11, 821, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestAllocateIPFromPool(t *testing.T) { tests := []struct { name string ipPools []*antreacrds.ExternalIPPool allocatedIP []struct { ip string pool string } expectedIPPool string expectedIP string expectError bool expectedIPPoolStatus []antreacrds.ExternalIPPoolUsage }{ { name: "allocate from proper IP pool", ipPools: []*antreacrds.ExternalIPPool{ newExternalIPPool("eip1", "", "10.10.10.2", "10.10.10.3"), }, allocatedIP: nil, expectedIPPool: "eip1", expectedIP: "10.10.10.2", expectError: false, expectedIPPoolStatus: []antreacrds.ExternalIPPoolUsage{ {Total: 2, Used: 1}, }, }, { name: "allocate from IP pools and one is full", ipPools: []*antreacrds.ExternalIPPool{ newExternalIPPool("eip1", "", "10.10.10.2", "10.10.10.3"), newExternalIPPool("eip2", "", "10.10.11.2", "10.10.11.3"), }, allocatedIP: []struct { ip string pool string }{ {"10.10.10.2", "eip1"}, {"10.10.10.3", "eip1"}, }, expectedIPPool: "eip2", expectedIP: "10.10.11.2", expectError: false, expectedIPPoolStatus: []antreacrds.ExternalIPPoolUsage{ {Total: 2, Used: 2}, {Total: 2, Used: 1}, }, }, { name: "allocate from IP pools and all are full", ipPools: []*antreacrds.ExternalIPPool{ newExternalIPPool("eip1", "", "10.10.10.2", "10.10.10.3"), newExternalIPPool("eip2", "", "10.10.11.2", "10.10.11.3"), }, allocatedIP: []struct { ip string pool string }{ {"10.10.10.2", "eip1"}, {"10.10.10.3", "eip1"}, {"10.10.11.2", "eip2"}, {"10.10.11.3", "eip2"}, }, expectedIPPool: "", expectedIP: "", expectError: true, expectedIPPoolStatus: []antreacrds.ExternalIPPoolUsage{ {Total: 2, Used: 2}, {Total: 2, Used: 2}, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { stopCh := make(chan struct{}) defer close(stopCh) var fakeCRDObjects []runtime.Object for _, p := range tt.ipPools { fakeCRDObjects = append(fakeCRDObjects, p) } controller := newController(fakeCRDObjects) controller.crdInformerFactory.Start(stopCh) controller.crdInformerFactory.WaitForCacheSync(stopCh) go controller.Run(stopCh) require.True(t, cache.WaitForCacheSync(stopCh, controller.HasSynced)) for _, alloc := range tt.allocatedIP { require.NoError(t, controller.UpdateIPAllocation(alloc.pool, net.ParseIP(alloc.ip))) } ipPoolGot, ipGot, err := controller.AllocateIP() assert.Equal(t, tt.expectError, err != nil) assert.Equal(t, net.ParseIP(tt.expectedIP), ipGot) assert.Equal(t, tt.expectedIPPool, ipPoolGot) for idx, pool := range tt.ipPools { checkExternalIPPoolStatus(t, controller, pool.Name, tt.expectedIPPoolStatus[idx]) } }) } }
explode_data.jsonl/10258
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1352 }
[ 2830, 3393, 75380, 3298, 3830, 10551, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 46531, 47, 6178, 257, 29838, 517, 265, 64748, 5356, 5121, 15342, 3298, 10551, 198, 197, 197, 57372, 3298, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestSpatialObjectToWKBHex(t *testing.T) { testCases := []struct { ewkt geopb.EWKT expected string }{ {"POINT(1.0 1.0)", "0101000000000000000000F03F000000000000F03F"}, {"SRID=4004;POINT(1.0 1.0)", "0101000000000000000000F03F000000000000F03F"}, } for _, tc := range testCases { t.Run(string(tc.ewkt), func(t *testing.T) { so, err := parseEWKT(geopb.SpatialObjectType_GeometryType, tc.ewkt, geopb.DefaultGeometrySRID, DefaultSRIDIsHint) require.NoError(t, err) encoded, err := SpatialObjectToWKBHex(so) require.NoError(t, err) require.Equal(t, tc.expected, encoded) }) } }
explode_data.jsonl/31777
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 267 }
[ 2830, 3393, 90618, 1190, 1249, 54, 29862, 20335, 1155, 353, 8840, 836, 8, 341, 18185, 37302, 1669, 3056, 1235, 341, 197, 197, 365, 5840, 257, 3893, 453, 65, 5142, 54, 33539, 198, 197, 42400, 914, 198, 197, 59403, 197, 197, 4913, 21531...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestMemorySwapUsage(t *testing.T) { if !PathExists("/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes") { t.Skip("skipping the test as it requires memory.memsw.limit_in_bytes to be set") } c, err := NewContainer(ContainerName) if err != nil { t.Errorf(err.Error()) } if _, err := c.MemorySwapUsage(); err != nil { t.Errorf(err.Error()) } }
explode_data.jsonl/2780
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 144 }
[ 2830, 3393, 10642, 46179, 14783, 1155, 353, 8840, 836, 8, 341, 743, 753, 1820, 15575, 4283, 7791, 73036, 2899, 4074, 79671, 79671, 41493, 2280, 38583, 1243, 12524, 899, 341, 197, 3244, 57776, 445, 4886, 5654, 279, 1273, 438, 432, 7460, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestEvalNil(t *testing.T) { var b *string var result, e = Eval("nil!=b", "!=", nil, b) if e != nil { t.Fatal(e) } if result.(bool) == true { t.Fatal("express != nil fail") } }
explode_data.jsonl/52553
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 90 }
[ 2830, 3393, 54469, 19064, 1155, 353, 8840, 836, 8, 341, 2405, 293, 353, 917, 198, 2405, 1102, 11, 384, 284, 58239, 445, 8385, 5824, 65, 497, 53074, 21369, 2092, 11, 293, 340, 743, 384, 961, 2092, 341, 197, 3244, 26133, 2026, 340, 19...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestActivateDeactivateMigrations(t *testing.T) { createMigratedDeployment(t) createMigratedStatefulSet(t) cmdArgs := []string{"activate", "migrations", "-n", "dep"} expected := "Updated replicas for deployment dep/migratedDeployment to 1\n" testCommon(t, cmdArgs, nil, expected, false) cmdArgs = []string{"activate", "migrations", "-n", "sts"} expected = "Updated replicas for statefulset sts/migratedStatefulSet to 3\n" testCommon(t, cmdArgs, nil, expected, false) cmdArgs = []string{"deactivate", "migrations", "-n", "dep"} expected = "Updated replicas for deployment dep/migratedDeployment to 0\n" testCommon(t, cmdArgs, nil, expected, false) cmdArgs = []string{"deactivate", "migrations", "-n", "sts"} expected = "Updated replicas for statefulset sts/migratedStatefulSet to 0\n" testCommon(t, cmdArgs, nil, expected, false) cmdArgs = []string{"activate", "migrations", "-a"} expected = "Updated replicas for deployment dep/migratedDeployment to 1\n" expected += "Updated replicas for statefulset sts/migratedStatefulSet to 3\n" testCommon(t, cmdArgs, nil, expected, false) cmdArgs = []string{"deactivate", "migrations", "-a"} expected = "Updated replicas for deployment dep/migratedDeployment to 0\n" expected += "Updated replicas for statefulset sts/migratedStatefulSet to 0\n" testCommon(t, cmdArgs, nil, expected, false) }
explode_data.jsonl/18262
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 439 }
[ 2830, 3393, 31242, 1912, 16856, 44, 17824, 1155, 353, 8840, 836, 8, 1476, 39263, 44, 94830, 75286, 1155, 340, 39263, 44, 94830, 1397, 1262, 1649, 1155, 340, 25920, 4117, 1669, 3056, 917, 4913, 16856, 497, 330, 76, 17824, 497, 6523, 77, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestResourceSQLGlobalConfigCreateWithData(t *testing.T) { d, err := qa.ResourceFixture{ Fixtures: []qa.HTTPFixture{ { Method: "PUT", Resource: "/api/2.0/sql/config/endpoints", ExpectedRequest: GlobalConfigForRead{ DataAccessConfig: []confPair{{Key: "spark.sql.session.timeZone", Value: "UTC"}}, SqlConfigurationParameters: &repeatedEndpointConfPairs{ConfigPairs: []confPair{{Key: "ANSI_MODE", Value: "true"}}}, EnableServerlessCompute: false, SecurityPolicy: "PASSTHROUGH", InstanceProfileARN: "arn:...", }, }, { Method: "GET", Resource: "/api/2.0/sql/config/endpoints", ReuseRequest: true, Response: GlobalConfigForRead{ SecurityPolicy: "PASSTHROUGH", DataAccessConfig: []confPair{ {Key: "spark.sql.session.timeZone", Value: "UTC"}, }, InstanceProfileARN: "arn:...", SqlConfigurationParameters: &repeatedEndpointConfPairs{ ConfigPairs: []confPair{ {Key: "ANSI_MODE", Value: "true"}, }, }, }, }, }, Resource: ResourceSQLGlobalConfig(), Create: true, State: map[string]interface{}{ "security_policy": "PASSTHROUGH", "instance_profile_arn": "arn:...", "data_access_config": map[string]interface{}{ "spark.sql.session.timeZone": "UTC", }, "sql_config_params": map[string]interface{}{ "ANSI_MODE": "true", }, }, }.Apply(t) require.NoError(t, err, err) assert.Equal(t, "global", d.Id(), "Id should not be empty") assert.Equal(t, "PASSTHROUGH", d.Get("security_policy")) }
explode_data.jsonl/48784
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 720 }
[ 2830, 3393, 4783, 6688, 11646, 2648, 4021, 80356, 1155, 353, 8840, 836, 8, 341, 2698, 11, 1848, 1669, 88496, 20766, 18930, 515, 197, 12727, 941, 18513, 25, 3056, 15445, 27358, 18930, 515, 298, 197, 515, 571, 84589, 25, 256, 330, 6221, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestTextAttachment(t *testing.T) { allure.Test(t, allure.Description("Testing a text attachment"), allure.Action(func() { _ = allure.AddAttachment("text!", allure.TextPlain, []byte("Some text!")) })) }
explode_data.jsonl/58996
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 74 }
[ 2830, 3393, 1178, 33569, 1155, 353, 8840, 836, 8, 341, 50960, 552, 8787, 1155, 11, 87403, 28773, 445, 16451, 264, 1467, 19984, 3975, 87403, 11360, 18552, 368, 341, 197, 197, 62, 284, 87403, 1904, 33569, 445, 1318, 18789, 87403, 1979, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestSort_Cycled(test *testing.T) { var g = graph{ 0: {1}, 1: {2}, 2: {3}, 3: {4}, 4: {0}, } var nodes = g.All() var sorted, hasCycle = tsort.Sort(nodes, g.From) if !hasCycle { test.Fatalf("graph %v expected to be cycled: %v", g, sorted) } }
explode_data.jsonl/20779
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 131 }
[ 2830, 3393, 10231, 920, 36576, 8623, 353, 8840, 836, 8, 341, 2405, 342, 284, 4771, 515, 197, 197, 15, 25, 314, 16, 1583, 197, 197, 16, 25, 314, 17, 1583, 197, 197, 17, 25, 314, 18, 1583, 197, 197, 18, 25, 314, 19, 1583, 197, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestROM_BusWriter_Bank00_Success(t *testing.T) { contents := sampleROM() rom, err := NewROM("", contents) if err != nil { t.Fatal(err) } // write to bus writer: w := rom.BusWriter(0x00FFEA) p := uint16(0x80c8) err = binary.Write(w, binary.LittleEndian, &p) if err != nil { t.Fatal(err) } // read it from the rom.Contents: err = binary.Read(bytes.NewReader(rom.Contents[0x007FEA:]), binary.LittleEndian, &p) if err != nil { t.Fatal(err) } if p != 0x80c8 { t.Fatal("expected NMI vector at $FFEA") } // Also test ReadHeader for bank 00 access: err = rom.ReadHeader() if err != nil { t.Fatal(err) } if rom.Header.NativeVectors.NMI != 0x80c8 { t.Fatal("ReadHeader should update NMI vector at $FFEA") } }
explode_data.jsonl/69478
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 316 }
[ 2830, 3393, 3361, 1668, 355, 6492, 1668, 1180, 15, 15, 87161, 1155, 353, 8840, 836, 8, 341, 197, 17610, 1669, 6077, 3361, 741, 197, 441, 11, 1848, 1669, 1532, 3361, 19814, 8794, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
func TestDoClusterResizeDefault(t *testing.T) { err := doClusterResize(MockApiClient{ cluster: Cluster{ ID: "REDIS", BundleType: "REDIS", }, }, "mock", MockResourceData{}, []Bundle{ {Bundle: "REDIS"}, }) if err == nil || !strings.Contains(err.Error(), "CDC resize does not support:") { t.Fatalf("Expect err with 'CDC resize does not support:' but got %v", err) } }
explode_data.jsonl/3834
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 162 }
[ 2830, 3393, 5404, 28678, 30561, 3675, 1155, 353, 8840, 836, 8, 341, 9859, 1669, 653, 28678, 30561, 66436, 56584, 515, 197, 197, 18855, 25, 35380, 515, 298, 29580, 25, 260, 330, 94512, 756, 298, 197, 8409, 929, 25, 330, 94512, 756, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestInstances(t *testing.T) { testVM, _, cfg, ok := configFromEnv() if !ok { t.Skipf("No config found in environment") } NodeName := types.NodeName(testVM) pc, err := newPCCloud(cfg) if err != nil { t.Fatalf("Failed to create new Photon client: %s", err) } i, ok := pc.Instances() if !ok { t.Fatalf("Instances() returned false") } nonExistingVM := types.NodeName(rand.String(15)) instanceId, err := i.InstanceID(context.TODO(), NodeName) if err != nil { t.Fatalf("Instances.InstanceID(%s) failed: %s", testVM, err) } t.Logf("Found InstanceID(%s) = %s\n", testVM, instanceId) instanceId, err = i.InstanceID(context.TODO(), nonExistingVM) if err == cloudprovider.InstanceNotFound { t.Logf("VM %s was not found as expected\n", nonExistingVM) } else if err == nil { t.Fatalf("Instances.InstanceID did not fail as expected, VM %s was found", nonExistingVM) } else { t.Fatalf("Instances.InstanceID did not fail as expected, err: %v", err) } addrs, err := i.NodeAddresses(context.TODO(), NodeName) if err != nil { t.Fatalf("Instances.NodeAddresses(%s) failed: %s", testVM, err) } t.Logf("Found NodeAddresses(%s) = %s\n", testVM, addrs) }
explode_data.jsonl/21917
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 468 }
[ 2830, 3393, 42725, 1155, 353, 8840, 836, 8, 341, 18185, 11187, 11, 8358, 13286, 11, 5394, 1669, 2193, 3830, 14359, 741, 743, 753, 562, 341, 197, 3244, 57776, 69, 445, 2753, 2193, 1730, 304, 4573, 1138, 197, 532, 30217, 675, 1669, 4494...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
8
func TestRedis(t *testing.T) { //Initialize Redis with some test values. authOpts := make(map[string]string) authOpts["redis_host"] = "localhost" authOpts["redis_port"] = "6379" authOpts["redis_db"] = "2" authOpts["redis_password"] = "" ctx := context.Background() testRedis(ctx, t, authOpts) }
explode_data.jsonl/34523
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 121 }
[ 2830, 3393, 48137, 1155, 353, 8840, 836, 8, 1476, 197, 322, 9928, 34158, 448, 1045, 1273, 2750, 624, 78011, 43451, 1669, 1281, 9147, 14032, 30953, 340, 78011, 43451, 1183, 21748, 12848, 1341, 284, 330, 8301, 698, 78011, 43451, 1183, 21748...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestNewEvent(t *testing.T) { ref := fftypes.NewUUID() tx := fftypes.NewUUID() e := NewEvent(EventTypeMessageConfirmed, "ns1", ref, tx, "topic1") assert.Equal(t, EventTypeMessageConfirmed, e.Type) assert.Equal(t, "ns1", e.Namespace) assert.Equal(t, *ref, *e.Reference) assert.Equal(t, *tx, *e.Transaction) assert.Equal(t, "topic1", e.Topic) e.Sequence = 12345 var ls LocallySequenced = e assert.Equal(t, int64(12345), ls.LocalSequence()) }
explode_data.jsonl/40818
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 192 }
[ 2830, 3393, 3564, 1556, 1155, 353, 8840, 836, 8, 1476, 59504, 1669, 43700, 1804, 7121, 24754, 741, 46237, 1669, 43700, 1804, 7121, 24754, 741, 7727, 1669, 1532, 1556, 30469, 929, 2052, 47948, 11, 330, 4412, 16, 497, 2053, 11, 9854, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGroupInter(t *testing.T) { v := &Value{data: []interface{}{interface{}("something"), interface{}("something"), interface{}("something"), interface{}("something"), interface{}("something"), interface{}("something")}} grouped := v.GroupInter(func(i int, val interface{}) string { return fmt.Sprintf("%v", i%2 == 0) }).data.(map[string][]interface{}) assert.Equal(t, 2, len(grouped)) assert.Equal(t, 3, len(grouped["true"])) assert.Equal(t, 3, len(grouped["false"])) }
explode_data.jsonl/23381
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 172 }
[ 2830, 3393, 2808, 3306, 1155, 353, 8840, 836, 8, 1476, 5195, 1669, 609, 1130, 90, 691, 25, 3056, 4970, 6257, 90, 4970, 6257, 445, 33331, 3975, 3749, 6257, 445, 33331, 3975, 3749, 6257, 445, 33331, 3975, 3749, 6257, 445, 33331, 3975, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestReminderFires(t *testing.T) { testActorsRuntime := newTestActorsRuntime() actorType, actorID := getTestActorTypeAndID() reminder := createReminder(actorID, actorType, "reminder1", "100ms", "100ms", "a") err := testActorsRuntime.CreateReminder(&reminder) assert.Nil(t, err) time.Sleep(time.Millisecond * 250) actorKey := testActorsRuntime.constructCompositeKey(actorType, actorID) track, err := testActorsRuntime.getReminderTrack(actorKey, "reminder1") assert.Nil(t, err) assert.NotNil(t, track) assert.NotEmpty(t, track.LastFiredTime) }
explode_data.jsonl/12882
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 201 }
[ 2830, 3393, 95359, 37, 3861, 1155, 353, 8840, 836, 8, 341, 18185, 2414, 1087, 15123, 1669, 501, 2271, 2414, 1087, 15123, 741, 93410, 929, 11, 12089, 915, 1669, 633, 2271, 18870, 929, 3036, 915, 741, 197, 77905, 1669, 1855, 95359, 65451,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestMatchHostnames(t *testing.T) { for i, test := range matchHostnamesTests { r := matchHostnames(test.pattern, test.host) if r != test.ok { t.Errorf("#%d mismatch got: %t want: %t when matching '%s' against '%s'", i, r, test.ok, test.host, test.pattern) } } }
explode_data.jsonl/67979
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 112 }
[ 2830, 3393, 8331, 9296, 11400, 1155, 353, 8840, 836, 8, 341, 2023, 600, 11, 1273, 1669, 2088, 2432, 9296, 11400, 18200, 341, 197, 7000, 1669, 2432, 9296, 11400, 8623, 39109, 11, 1273, 17840, 340, 197, 743, 435, 961, 1273, 18165, 341, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestIsKey(t *testing.T) { key := GenerateSecp256k1().GenPublic() peerID := key.PeerID() if !peerID.IsKey(key) { t.Fatal("fail to test is key function") } }
explode_data.jsonl/54177
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 71 }
[ 2830, 3393, 3872, 1592, 1155, 353, 8840, 836, 8, 341, 23634, 1669, 19813, 8430, 79, 17, 20, 21, 74, 16, 1005, 9967, 12676, 741, 197, 16537, 915, 1669, 1376, 1069, 34756, 915, 2822, 743, 753, 16537, 915, 4506, 1592, 4857, 8, 341, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
func TestRD(t *testing.T) { for _, ut := range rdTests { if newRD := rd(ut.in.Rank, defaultOptions); ut.out != newRD { t.Errorf("TestRD() = %+v, want %+v.", newRD, ut.out) } } }
explode_data.jsonl/22939
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 101 }
[ 2830, 3393, 36690, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 8621, 1669, 2088, 22694, 18200, 341, 394, 421, 501, 36690, 1669, 22694, 7, 332, 1858, 2013, 1180, 11, 1638, 3798, 1215, 8621, 2532, 961, 501, 36690, 341, 298, 3244, 13080, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestContext_Read(t *testing.T) { a := assert.New(t, false) r, err := http.NewRequest(http.MethodPost, "/path", bytes.NewBufferString("test,123")) a.NotError(err).NotNil(r) w := httptest.NewRecorder() r.Header.Set("Content-Type", text.Mimetype+"; charset=utf-8") ctx := newServer(a, nil).NewContext(w, r) obj := &testobject.TextObject{} a.Nil(ctx.Read(obj, "41110")) a.Equal(obj.Name, "test").Equal(obj.Age, 123) o := &struct{}{} resp := ctx.Read(o, "41110") a.NotNil(resp) a.Equal(resp.Status(), http.StatusUnprocessableEntity) }
explode_data.jsonl/34205
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 233 }
[ 2830, 3393, 1972, 38381, 1155, 353, 8840, 836, 8, 341, 11323, 1669, 2060, 7121, 1155, 11, 895, 340, 7000, 11, 1848, 1669, 1758, 75274, 19886, 20798, 4133, 11, 3521, 2343, 497, 5820, 7121, 4095, 703, 445, 1944, 11, 16, 17, 18, 5455, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestLinkedList_String(t *testing.T) { type fields struct { head *Node } tests := []struct { name string fields fields want string }{ { name: "Empty list", fields: fields{head: nil}, want: "", }, { name: "Single node list", fields: fields{head: &Node{value: 10}}, want: "10", }, { name: "Multiple nodes", fields: fields{head: &Node{ value: 10, next: &Node{ value: 20, next: &Node{ value: 30, next: nil, }, }, }}, want: "10 => 20 => 30", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { list := LinkedList{ head: tt.fields.head, } if got := list.String(); got != tt.want { t.Errorf("String() = %v, want %v", got, tt.want) } }) } }
explode_data.jsonl/40419
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 399 }
[ 2830, 3393, 33915, 31777, 1155, 353, 8840, 836, 8, 341, 13158, 5043, 2036, 341, 197, 46081, 353, 1955, 198, 197, 532, 78216, 1669, 3056, 1235, 341, 197, 11609, 256, 914, 198, 197, 55276, 5043, 198, 197, 50780, 256, 914, 198, 197, 5940...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestSetCtxGrpcMethod(t *testing.T) { expectFullMethodName := "/pinkypb/TakeOverTheWorld.SNARF" ctx := testhelper.SetCtxGrpcMethod(context.Background(), expectFullMethodName) actualFullMethodName, ok := grpc.Method(ctx) require.True(t, ok, "expected context to contain server transport stream") require.Equal(t, expectFullMethodName, actualFullMethodName) }
explode_data.jsonl/43794
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 119 }
[ 2830, 3393, 1649, 23684, 6464, 3992, 3523, 1155, 353, 8840, 836, 8, 341, 24952, 9432, 75648, 1669, 3521, 63249, 1082, 65, 16731, 726, 1918, 785, 10134, 808, 45, 934, 37, 698, 20985, 1669, 1273, 18764, 4202, 23684, 6464, 3992, 3523, 5378...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestRequireMetricsEqual(t *testing.T) { tests := []struct { name string got telegraf.Metric want telegraf.Metric }{ { name: "telegraf and testutil metrics should be equal", got: func() telegraf.Metric { m, _ := metric.New( "test", map[string]string{ "t1": "v1", "t2": "v2", }, map[string]interface{}{ "f1": 1, "f2": 3.14, "f3": "v3", }, time.Unix(0, 0), ) return m }(), want: func() telegraf.Metric { m, _ := metric.New( "test", map[string]string{ "t1": "v1", "t2": "v2", }, map[string]interface{}{ "f1": int64(1), "f2": 3.14, "f3": "v3", }, time.Unix(0, 0), ) return m }(), }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { RequireMetricEqual(t, tt.want, tt.got) }) } }
explode_data.jsonl/64546
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 511 }
[ 2830, 3393, 17959, 27328, 2993, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 914, 198, 197, 3174, 354, 220, 7963, 76039, 1321, 16340, 198, 197, 50780, 7963, 76039, 1321, 16340, 198, 197, 59403, 197, 197, 515, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestDefaultConfig(t *testing.T) { t.Run("base", func(t *testing.T) { defaultAgentURL := "http://" + net.JoinHostPort(defaultAgentHost, defaultAgentPort) + "/profiling/v1/input" cfg, err := defaultConfig() require.NoError(t, err) assert := assert.New(t) assert.Equal(defaultAPIURL, cfg.apiURL) assert.Equal(defaultAgentURL, cfg.agentURL) assert.Equal(defaultEnv, cfg.env) assert.Equal(filepath.Base(os.Args[0]), cfg.service) assert.Equal(len(defaultProfileTypes), len(cfg.types)) for _, pt := range defaultProfileTypes { _, ok := cfg.types[pt] assert.True(ok) } _, ok := cfg.statsd.(*statsd.NoOpClient) assert.True(ok) assert.Equal(DefaultPeriod, cfg.period) assert.Equal(DefaultDuration, cfg.cpuDuration) assert.Equal(DefaultMutexFraction, cfg.mutexFraction) assert.Equal(DefaultBlockRate, cfg.blockRate) assert.Contains(cfg.tags, "runtime-id:"+globalconfig.RuntimeID()) }) }
explode_data.jsonl/18537
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 370 }
[ 2830, 3393, 3675, 2648, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 3152, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 11940, 16810, 3144, 1669, 330, 1254, 52136, 488, 4179, 22363, 9296, 7084, 18978, 16810, 9296, 11, 1638, 16810, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestDequeueOnEmptyQueue(t *testing.T) { q := queueint.NewQueueInt() v := q.Dequeue() assert.Equal(t, v, -1) assert.Equal(t, "[]", q.Print()) }
explode_data.jsonl/77134
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 67 }
[ 2830, 3393, 1912, 4584, 1925, 3522, 7554, 1155, 353, 8840, 836, 8, 341, 18534, 1669, 7177, 396, 7121, 7554, 1072, 741, 5195, 1669, 2804, 8934, 4584, 2822, 6948, 12808, 1155, 11, 348, 11, 481, 16, 340, 6948, 12808, 1155, 11, 330, 1294,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestEventId(t *testing.T) { var table = []struct { definition string expectations map[string]common.Hash }{ { definition: `[ { "type" : "event", "name" : "Balance", "inputs": [{ "name" : "in", "type": "uint256" }] }, { "type" : "event", "name" : "Check", "inputs": [{ "name" : "t", "type": "address" }, { "name": "b", "type": "uint256" }] } ]`, expectations: map[string]common.Hash{ "Balance": crypto.Keccak256Hash([]byte("Balance(uint256)")), "Check": crypto.Keccak256Hash([]byte("Check(address,uint256)")), }, }, } for _, test := range table { abi, err := JSON(strings.NewReader(test.definition)) if err != nil { t.Fatal(err) } for name, event := range abi.Events { if event.ID() != test.expectations[name] { t.Errorf("expected id to be %x, got %x", test.expectations[name], event.ID()) } } } }
explode_data.jsonl/43923
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 374 }
[ 2830, 3393, 1556, 764, 1155, 353, 8840, 836, 8, 341, 2405, 1965, 284, 3056, 1235, 341, 197, 7452, 4054, 256, 914, 198, 197, 24952, 804, 2415, 14032, 60, 5464, 15103, 198, 197, 59403, 197, 197, 515, 298, 7452, 4054, 25, 1565, 9640, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestParseComplex128(t *testing.T) { type testElement struct { s string c complex128 err bool } tests := []testElement{ {"", 0, true}, {"i", 0, true}, {"+", 0, true}, {"-", 0, true}, {"a", 0, true}, {"(", 0, true}, {")", 0, true}, {"(0", 0, true}, {"0)", 0, true}, {"1+1", 0, true}, {"123a45+1i", 0, true}, {"1+123a45i", 0, true}, {"0", 0, false}, {"1.2", 1.2, false}, {"+1.2", 1.2, false}, {"-1.2", -1.2, false}, {"3.4i", 3.4i, false}, {"+3.4i", 3.4i, false}, {"-3.4i", -3.4i, false}, {"1.2-3.4i", 1.2 - 3.4i, false}, {"1.2+3.4i", 1.2 + 3.4i, false}, {"+1.2-3.4i", 1.2 - 3.4i, false}, {"+1.2+3.4i", 1.2 + 3.4i, false}, {"-1.2-3.4i", -1.2 - 3.4i, false}, {"-1.2+3.4i", -1.2 + 3.4i, false}, {"(1.2-3.4i)", 1.2 - 3.4i, false}, } for _, test := range tests { c, err := ParseComplex128(test.s) if c != test.c || err != nil != test.err { t.Errorf("%v: expect %v %v, got %v %v", test.s, test.c, test.err, c, err) } } }
explode_data.jsonl/8457
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 562 }
[ 2830, 3393, 14463, 31137, 16, 17, 23, 1155, 353, 8840, 836, 8, 341, 13158, 1273, 1691, 2036, 341, 197, 1903, 256, 914, 198, 197, 1444, 256, 6351, 16, 17, 23, 198, 197, 9859, 1807, 198, 197, 630, 78216, 1669, 3056, 1944, 1691, 515, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestGetQueueExists(t *testing.T) { serv, client := setUp(t) defer tearDown(t, serv) createdQueue := createTestQueue(t, client) getQueueRequest := taskspb.GetQueueRequest{ Name: createdQueue.GetName(), } gettedQueue, err := client.GetQueue(context.Background(), &getQueueRequest) assert.NoError(t, err) assert.Equal(t, createdQueue.GetName(), gettedQueue.GetName()) }
explode_data.jsonl/72418
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 133 }
[ 2830, 3393, 1949, 7554, 15575, 1155, 353, 8840, 836, 8, 341, 1903, 648, 11, 2943, 1669, 18620, 1155, 340, 16867, 32825, 1155, 11, 4853, 692, 197, 7120, 7554, 1669, 1855, 2271, 7554, 1155, 11, 2943, 692, 10366, 7554, 1900, 1669, 3383, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func Test_regexes(t *testing.T) { id_testcases := map[string]struct{ test string match matcher expected int }{ "url1": {"http://" + api.Endpoint + "/post/show/111", apiurlmatch, 111}, "url2": {"https://www." + api.Endpoint + "/posts/111", apiurlmatch, 111}, "url3": {api.FilteredEndpoint + "/post/show/111", apiurlmatch, 111}, "url4": {"link among a string " + api.FilteredEndpoint + "/post/show/111 yadda yadda", apiurlmatch, 111}, "url5": {"(" + api.FilteredEndpoint + "/post/show/111)", apiurlmatch, 111}, "url6": {api.FilteredEndpoint + "/post/show/111", apiurlmatch, 111}, "url7": {"htp:/" + api.FilteredEndpoint + ".nope/post/show/111", apiurlmatch, NONEXISTENT_POST}, "id1": {"222", numericmatch, 222}, "id2": {" x y z 222 yadda", numericmatch, 222}, "id3": {"(222)", numericmatch, 222}, "id4": {"#222", numericmatch, 222}, "id5": {"-222", numericmatch, NONEXISTENT_POST}, } string_testcases := map[string]struct{ test string match matcher expected string }{ "md5_1": {"md5:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_2": {" md5:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_3": {"(md5:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_4": {"md5:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", md5hashmatch, ""}, "md5_5": {"https://" + api.StaticPrefix + api.Endpoint + "/data/1F/F1/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.png", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_6": {"http://" + api.StaticPrefix + api.Endpoint + "/data/1F/F1/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.png", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_7": {"(" + api.StaticPrefix + api.Endpoint + "/data/1F/F1/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.png)", md5hashmatch, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}, "md5_8": {api.StaticPrefix + api.Endpoint + "/data/1F/F1/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.png", md5hashmatch, ""}, } for k, v := range id_testcases { t.Run(k, func(t *testing.T) { out := v.match.Match(v.test) if out != v.expected { t.Errorf("Unexpected result: got %d, expected %d (%s)", out, v.expected, v.test) } }) } for k, v := range string_testcases { t.Run(k, func(t *testing.T) { out := v.match.MatchString(v.test) if out != v.expected { t.Errorf("Unexpected result: got %s, expected %s (%s)", out, v.expected, v.test) } }) } }
explode_data.jsonl/42357
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 905 }
[ 2830, 3393, 41832, 288, 1155, 353, 8840, 836, 8, 341, 15710, 4452, 23910, 1669, 2415, 14032, 60, 1235, 515, 197, 18185, 914, 198, 197, 47706, 36052, 198, 197, 42400, 526, 198, 197, 59403, 197, 197, 60260, 16, 788, 5212, 1254, 52136, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2