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 TestStepsOnExit(t *testing.T) { controller := newController() wfcset := controller.wfclientset.ArgoprojV1alpha1().Workflows("") // Test list expansion wf := unmarshalWF(stepsOnExit) wf, err := wfcset.Create(wf) assert.Nil(t, err) woc := newWorkflowOperationCtx(wf, controller) woc.operate() woc.operate() wf, err = wfcset.Get(wf.ObjectMeta.Name, metav1.GetOptions{}) assert.Nil(t, err) onExitNodeIsPresent := false for _, node := range wf.Status.Nodes { if strings.Contains(node.Name, "onExit") { onExitNodeIsPresent = true break } } assert.True(t, onExitNodeIsPresent) }
explode_data.jsonl/54390
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 250 }
[ 2830, 3393, 33951, 1925, 15339, 1155, 353, 8840, 836, 8, 341, 61615, 1669, 501, 2051, 741, 6692, 8316, 746, 1669, 6461, 1418, 69, 2972, 746, 18979, 45926, 73, 53, 16, 7141, 16, 1005, 6776, 38140, 445, 5130, 197, 322, 3393, 1140, 14461...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRouterGroupDispatch(t *testing.T) { g1 := RouteGroup("one") g2 := RouteGroup("two") g1.AddGroup(g2) g2.Add("test", &Handler{}) c := &Context{Params: Params{}, Request: &http.Request{}} if !g1.Match("one/two/test", c) { t.Errorf("Route did not match") } err := g1.Dispatch(c) if _, ok := err.(*MethodNotImplementedError); !ok { t.Errorf("Dispatch failed: %s", err) } }
explode_data.jsonl/35809
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 166 }
[ 2830, 3393, 9523, 2808, 11283, 1155, 353, 8840, 836, 8, 341, 3174, 16, 1669, 9572, 2808, 445, 603, 1138, 3174, 17, 1669, 9572, 2808, 445, 19789, 5130, 3174, 16, 1904, 2808, 3268, 17, 340, 3174, 17, 1904, 445, 1944, 497, 609, 3050, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCornerCases(t *testing.T) { t.Parallel() // Create a file at the datapase path to force the open below to fail. dbPath := filepath.Join(os.TempDir(), "ffldb-errors") _ = os.RemoveAll(dbPath) fi, err := os.Create(dbPath) if err != nil { t.Errorf("os.Create: unexpected error: %v", err) return } fi.Close() // Ensure creating a new database fails when a file exists where a // directory is needed. testName := "openDB: fail due to file at target location" wantErrCode := database.ErrDriverSpecific idb, err := openDB(dbPath, blockDataNet, true) if !checkDbError(t, testName, err, wantErrCode) { if err == nil { idb.Close() } _ = os.RemoveAll(dbPath) return } // Remove the file and create the database to run tests against. It // should be successful this time. _ = os.RemoveAll(dbPath) idb, err = openDB(dbPath, blockDataNet, true) if err != nil { t.Errorf("openDB: unexpected error: %v", err) return } defer os.RemoveAll(dbPath) defer idb.Close() // Ensure attempting to write to a file that can't be created returns // the expected error. testName = "writeBlock: open file failure" filePath := blockFilePath(dbPath, 0) if err := os.Mkdir(filePath, 0755); err != nil { t.Errorf("os.Mkdir: unexpected error: %v", err) return } store := idb.(*db).store _, err = store.writeBlock([]byte{0x00}) if !checkDbError(t, testName, err, database.ErrDriverSpecific) { return } _ = os.RemoveAll(filePath) // Close the underlying leveldb database out from under the database. ldb := idb.(*db).cache.ldb ldb.Close() // Ensure initilization errors in the underlying database work as // expected. testName = "initDB: reinitialization" wantErrCode = database.ErrDbNotOpen err = initDB(ldb) if !checkDbError(t, testName, err, wantErrCode) { return } // Ensure the View handles errors in the underlying leveldb database // properly. testName = "View: underlying leveldb error" wantErrCode = database.ErrDbNotOpen err = idb.View(func(tx database.Tx) error { return nil }) if !checkDbError(t, testName, err, wantErrCode) { return } // Ensure the Update handles errors in the underlying leveldb database // properly. testName = "Update: underlying leveldb error" err = idb.Update(func(tx database.Tx) error { return nil }) if !checkDbError(t, testName, err, wantErrCode) { return } }
explode_data.jsonl/53812
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 857 }
[ 2830, 3393, 50352, 37302, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 197, 322, 4230, 264, 1034, 518, 279, 61723, 519, 1815, 311, 5344, 279, 1787, 3685, 311, 3690, 624, 20939, 1820, 1669, 26054, 22363, 9638, 65009, 6184, 1507...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCreateOAuthUser(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() r := rand.New(rand.NewSource(time.Now().UnixNano())) glUser := oauthgitlab.GitLabUser{Id: int64(r.Intn(1000)) + 1, Username: "o" + model.NewId(), Email: model.NewId() + "@simulator.amazonses.com", Name: "Joram Wilander"} json := glUser.ToJson() user, err := th.App.CreateOAuthUser(model.USER_AUTH_SERVICE_GITLAB, strings.NewReader(json), th.BasicTeam.Id) if err != nil { t.Fatal(err) } if user.Username != glUser.Username { t.Fatal("usernames didn't match") } th.App.PermanentDeleteUser(user) *th.App.Config().TeamSettings.EnableUserCreation = false _, err = th.App.CreateOAuthUser(model.USER_AUTH_SERVICE_GITLAB, strings.NewReader(json), th.BasicTeam.Id) if err == nil { t.Fatal("should have failed - user creation disabled") } }
explode_data.jsonl/31410
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 333 }
[ 2830, 3393, 4021, 57850, 1474, 1155, 353, 8840, 836, 8, 341, 70479, 1669, 18626, 1155, 568, 3803, 15944, 741, 16867, 270, 836, 682, 4454, 2822, 7000, 1669, 10382, 7121, 37595, 7121, 3608, 9730, 13244, 1005, 55832, 83819, 12145, 8946, 1474...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAllowNoAttrs(t *testing.T) { input := "<tag>test</tag>" outputFail := "test" outputOk := input p := NewPolicy() p.AllowElements("tag") if output := p.Sanitize(input); output != outputFail { t.Errorf( "test failed;\ninput : %s\noutput : %s\nexpected: %s", input, output, outputFail, ) } p.AllowNoAttrs().OnElements("tag") if output := p.Sanitize(input); output != outputOk { t.Errorf( "test failed;\ninput : %s\noutput : %s\nexpected: %s", input, output, outputOk, ) } }
explode_data.jsonl/28802
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 235 }
[ 2830, 3393, 18605, 2753, 53671, 1155, 353, 8840, 836, 8, 341, 22427, 1669, 4055, 4578, 29, 1944, 522, 4578, 19134, 21170, 19524, 1669, 330, 1944, 698, 21170, 11578, 1669, 1946, 271, 3223, 1669, 1532, 13825, 741, 3223, 29081, 11868, 445, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPrepareCachePointGetInsert(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() orgEnable := core.PreparedPlanCacheEnabled() defer core.SetPreparedPlanCache(orgEnable) core.SetPreparedPlanCache(true) se, err := session.CreateSession4TestWithOpt(store, &session.Opt{ PreparedPlanCache: kvcache.NewSimpleLRUCache(100, 0.1, math.MaxUint64), }) require.NoError(t, err) tk := testkit.NewTestKitWithSession(t, store, se) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("create table t1 (a int, b int, primary key(a))") tk.MustExec("insert into t1 values (1, 1), (2, 2), (3, 3)") tk.MustExec("create table t2 (a int, b int, primary key(a))") tk.MustExec(`prepare stmt1 from "insert into t2 select * from t1 where a=?"`) tk.MustExec("set @a=1") tk.MustExec("execute stmt1 using @a") tk.MustQuery(`select @@last_plan_from_cache`).Check(testkit.Rows("0")) tk.MustQuery("select * from t2 order by a").Check(testkit.Rows("1 1")) tk.MustExec("set @a=2") tk.MustExec("execute stmt1 using @a") tk.MustQuery(`select @@last_plan_from_cache`).Check(testkit.Rows("1")) tk.MustQuery("select * from t2 order by a").Check(testkit.Rows("1 1", "2 2")) tk.MustExec("set @a=3") tk.MustExec("execute stmt1 using @a") tk.MustQuery(`select @@last_plan_from_cache`).Check(testkit.Rows("1")) tk.MustQuery("select * from t2 order by a").Check(testkit.Rows("1 1", "2 2", "3 3")) }
explode_data.jsonl/5503
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 559 }
[ 2830, 3393, 50590, 8233, 2609, 1949, 13780, 1155, 353, 8840, 836, 8, 341, 57279, 11, 4240, 1669, 1273, 8226, 7251, 11571, 6093, 1155, 340, 16867, 4240, 741, 87625, 11084, 1669, 6200, 28770, 7212, 20485, 8233, 5462, 741, 16867, 6200, 4202,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_update_board_name_via_web_form(t *testing.T) { ctx := context.Background() board := createTestBoard(ctx) postData := url.Values{} postData.Set("_method", "PATCH") postData.Set("ID", fmt.Sprint(board.ID)) postData.Set("Name", "New Name") req := httptest.NewRequest("POST", fmt.Sprintf("/boards/%d", board.ID), strings.NewReader(postData.Encode())) req.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") req.Header.Set("Accept", "text/javascript") req.Header.Set("X-Requested-With", "XMLHttpRequest") w := httptest.NewRecorder() router.ServeHTTP(w, req) t.Log("Body:", w.Body) httpassert.Success(t, w) httpassert.JavascriptContentType(t, w) //updatedBoard, err := repo.GetBoardByID(board.ID) //if err != nil { // t.Fatalf("%+v", err) //} // //if updatedBoard.Name != "New Name" { // t.Errorf("Board name was not updated (was '%s')", board.Name) //} }
explode_data.jsonl/12544
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 360 }
[ 2830, 3393, 8882, 23919, 1269, 80710, 25960, 7915, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 59868, 1669, 1855, 2271, 11932, 7502, 692, 51172, 1043, 1669, 2515, 35145, 16094, 51172, 1043, 4202, 16975, 4393, 497, 330, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestControl_httpReq_onRetry(t *testing.T) { req := &httpReq{} err := req.onRetry(context.TODO(), 0) if err != nil { t.Fatalf("expected nil, got: %s", err.Error()) } }
explode_data.jsonl/59297
{ "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, 3273, 25888, 27234, 4470, 51560, 1155, 353, 8840, 836, 8, 341, 24395, 1669, 609, 1254, 27234, 16094, 9859, 1669, 4232, 3488, 51560, 5378, 90988, 1507, 220, 15, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 7325, 209...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_pull_ref_to_string(t *testing.T) { pullRef := NewPullRef("https://github.com/jenkins-x/jx", "master", "1234567") toString := pullRef.String() assert.Equal(t, "master:1234567", toString) }
explode_data.jsonl/82520
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 80 }
[ 2830, 3393, 65693, 7793, 2346, 3904, 1155, 353, 8840, 836, 8, 341, 3223, 617, 3945, 1669, 1532, 36068, 3945, 445, 2428, 1110, 5204, 905, 4437, 57006, 6558, 4437, 87, 497, 330, 13629, 497, 330, 16, 17, 18, 19, 20, 21, 22, 1138, 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 TestSqlite3_VersionSQL(t *testing.T) { a := assert.New(t, false) suite := test.NewSuite(a, test.Sqlite3) defer suite.Close() suite.ForEach(func(t *test.Driver) { testDialectVersionSQL(t) }) }
explode_data.jsonl/11874
{ "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, 8269, 632, 18, 85217, 6688, 1155, 353, 8840, 836, 8, 341, 11323, 1669, 2060, 7121, 1155, 11, 895, 340, 96572, 1669, 1273, 7121, 28000, 2877, 11, 1273, 23005, 632, 18, 340, 16867, 16182, 10421, 2822, 96572, 67743, 18552, 1155...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestWriteSegmentArray(t *testing.T) { test := func(t *testing.T, initializeConfig InitializeConfig, expected []string) { t.Helper() actual, err := WriteSegmentArray([]string{}, initializeConfig) if err != nil { t.Errorf("got %#v", err) } if !reflect.DeepEqual(actual, expected) { // Help developers see differences between the lines. pretty := func(lines []string) string { b := new(strings.Builder) fmt.Fprintln(b, "[") for _, l := range lines { fmt.Fprintf(b, " %q\n", l) } fmt.Fprint(b, "]") return b.String() } t.Errorf("got %v, want %v", pretty(actual), pretty(expected)) } } t.Run("renders the config file as expected", func(t *testing.T) { config := InitializeConfig{ Master: greenplum.SegConfig{ContentID: -1, DbID: 1, Hostname: "mdw", DataDir: "/data/qddir_upgrade/seg-1", Role: "p", Port: 15433}, Primaries: []greenplum.SegConfig{ {ContentID: 0, DbID: 2, Hostname: "sdw1", DataDir: "/data/dbfast1_upgrade/seg1", Role: "p", Port: 15434}, {ContentID: 1, DbID: 3, Hostname: "sdw2", DataDir: "/data/dbfast2_upgrade/seg2", Role: "p", Port: 15434}, }, } test(t, config, []string{ "QD_PRIMARY_ARRAY=mdw~15433~/data/qddir_upgrade/seg-1~1~-1", "declare -a PRIMARY_ARRAY=(", "\tsdw1~15434~/data/dbfast1_upgrade/seg1~2~0", "\tsdw2~15434~/data/dbfast2_upgrade/seg2~3~1", ")", }) }) t.Run("errors when source cluster contains no master segment", func(t *testing.T) { _, err := WriteSegmentArray([]string{}, InitializeConfig{}) if err == nil { t.Errorf("expected error got nil") } }) }
explode_data.jsonl/11386
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 710 }
[ 2830, 3393, 7985, 21086, 1857, 1155, 353, 8840, 836, 8, 341, 18185, 1669, 2915, 1155, 353, 8840, 836, 11, 9468, 2648, 9008, 2648, 11, 3601, 3056, 917, 8, 341, 197, 3244, 69282, 2822, 197, 88814, 11, 1848, 1669, 9645, 21086, 1857, 1055...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLoadArgs(t *testing.T) { kubeletArgs := "IgnoreUnknown=1;K8S_POD_NAMESPACE=istio-system;" + "K8S_POD_NAME=istio-sidecar-injector-8489cf78fb-48pvg;" + "K8S_POD_INFRA_CONTAINER_ID=3c41e946cf17a32760ff86940a73b06982f1815e9083cf2f4bfccb9b7605f326" k8sArgs := K8sArgs{} if err := types.LoadArgs(kubeletArgs, &k8sArgs); err != nil { t.Fatalf("LoadArgs failed with error: %v", err) } if string(k8sArgs.K8S_POD_NAMESPACE) == "" || string(k8sArgs.K8S_POD_NAME) == "" { t.Fatalf("LoadArgs didn't convert args properly, K8S_POD_NAME=\"%s\";K8S_POD_NAMESPACE=\"%s\"", string(k8sArgs.K8S_POD_NAME), string(k8sArgs.K8S_POD_NAMESPACE)) } }
explode_data.jsonl/17787
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 333 }
[ 2830, 3393, 5879, 4117, 1155, 353, 8840, 836, 8, 341, 16463, 3760, 1149, 4117, 1669, 330, 12497, 13790, 28, 16, 26, 42, 23, 50, 1088, 2069, 34552, 28, 380, 815, 36648, 10892, 3610, 197, 197, 1, 42, 23, 50, 1088, 2069, 4708, 28, 38...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLoadSaveCompression(t *testing.T) { t.Parallel() Convey("Compress lots of similar refs", t, func() { c := memory.Use(context.Background()) c, _, _ = tsmon.WithFakes(c) tsmon.GetState(c).SetStore(store.NewInMemory(&target.Task{})) repo := "https://example.googlesource.com/what/ever.git" jobID := "job" many16Ki := 16 * 1024 tags := make(map[string]string, many16Ki) for i := 0; i < many16Ki; i++ { ref := "refs/tags/" + strconv.FormatInt(int64(i), 20) hsh := fmt.Sprintf("%x", sha256.Sum256([]byte(ref)))[:40] tags[ref] = hsh } So(saveState(c, jobID, repo, tags), ShouldBeNil) id, err := repositoryID(jobID, repo) So(err, ShouldBeNil) stored := Repository{ID: id} So(ds.Get(c, &stored), ShouldBeNil) // Given that SHA1 must have high entropy and hence shouldn't be // compressible. Thus, we can't go below 20 bytes (len of SHA1) per ref, // hence 20*many16Ki = 320 KiB. So(len(stored.CompressedState), ShouldBeGreaterThan, 20*many16Ki) // But refs themselves should be quite compressible. So(len(stored.CompressedState), ShouldBeLessThan, 20*many16Ki*5/4) So(getSentMetric(c, metricTaskGitilesStoredRefs, jobID), ShouldEqual, many16Ki) So(getSentMetric(c, metricTaskGitilesStoredSize, jobID), ShouldEqual, len(stored.CompressedState)) }) }
explode_data.jsonl/52488
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 537 }
[ 2830, 3393, 5879, 8784, 81411, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 93070, 5617, 445, 1092, 1873, 10077, 315, 4428, 43143, 497, 259, 11, 2915, 368, 341, 197, 1444, 1669, 4938, 9046, 5378, 19047, 2398, 197, 1444, 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 TestGetSSGenBlockVotedOn(t *testing.T) { var ssgen = dcrutil.NewTx(ssgenMsgTx) ssgen.SetTree(wire.TxTreeStake) ssgen.SetIndex(0) blockHash, height := stake.SSGenBlockVotedOn(ssgen.MsgTx()) correctBlockHash, _ := chainhash.NewHash( []byte{ 0x94, 0x8c, 0x76, 0x5a, // 32 byte hash 0x69, 0x14, 0xd4, 0x3f, 0x2a, 0x7a, 0xc1, 0x77, 0xda, 0x2c, 0x2f, 0x6b, 0x52, 0xde, 0x3d, 0x7c, 0xda, 0x2c, 0x2f, 0x6b, 0x52, 0xde, 0x3d, 0x7c, 0x52, 0xde, 0x3d, 0x7c, }) correctheight := uint32(0x2123e300) if !reflect.DeepEqual(blockHash, *correctBlockHash) { t.Errorf("Error thrown on TestGetSSGenBlockVotedOn: Looking for "+ "hash %v, got hash %v", *correctBlockHash, blockHash) } if height != correctheight { t.Errorf("Error thrown on TestGetSSGenBlockVotedOn: Looking for "+ "height %v, got height %v", correctheight, height) } }
explode_data.jsonl/70512
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 424 }
[ 2830, 3393, 1949, 1220, 9967, 4713, 53, 9253, 1925, 1155, 353, 8840, 836, 8, 341, 2405, 274, 1991, 268, 284, 294, 5082, 1314, 7121, 31584, 30678, 4370, 6611, 31584, 340, 34472, 4370, 4202, 6533, 3622, 554, 81362, 6533, 623, 726, 340, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestK8sUpsertTimeout(t *testing.T) { f := newIBDFixture(t, k8s.EnvGKE) defer f.TearDown() timeout := 123 * time.Second state := f.st.LockMutableStateForTesting() state.UpdateSettings = state.UpdateSettings.WithK8sUpsertTimeout(123 * time.Second) f.st.UnlockMutableState() manifest := NewSanchoDockerBuildManifest(f) _, err := f.ibd.BuildAndDeploy(f.ctx, f.st, buildTargets(manifest), nil) if err != nil { t.Fatal(err) } assert.Equal(t, f.k8s.UpsertTimeout, timeout) }
explode_data.jsonl/38263
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 204 }
[ 2830, 3393, 42, 23, 82, 98778, 529, 7636, 1155, 353, 8840, 836, 8, 341, 1166, 1669, 501, 3256, 5262, 12735, 1155, 11, 595, 23, 82, 81214, 38, 3390, 340, 16867, 282, 836, 682, 4454, 2822, 78395, 1669, 220, 16, 17, 18, 353, 882, 324...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServerRun(t *testing.T) { // https://github.com/go-redis/redis/issues/1029 ignoreOpt := goleak.IgnoreTopFunction("github.com/go-redis/redis/v7/internal/pool.(*ConnPool).reaper") defer goleak.VerifyNoLeaks(t, ignoreOpt) srv := NewServer(RedisClientOpt{Addr: ":6379"}, Config{LogLevel: testLogLevel}) done := make(chan struct{}) // Make sure server exits when receiving TERM signal. go func() { time.Sleep(2 * time.Second) syscall.Kill(syscall.Getpid(), syscall.SIGTERM) done <- struct{}{} }() go func() { select { case <-time.After(10 * time.Second): panic("server did not stop after receiving TERM signal") case <-done: } }() mux := NewServeMux() if err := srv.Run(mux); err != nil { t.Fatal(err) } }
explode_data.jsonl/81843
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 299 }
[ 2830, 3393, 5475, 6727, 1155, 353, 8840, 836, 8, 341, 197, 322, 3703, 1110, 5204, 905, 25525, 12, 21748, 14, 21748, 38745, 14, 16, 15, 17, 24, 198, 197, 13130, 21367, 1669, 728, 273, 585, 48590, 5366, 5152, 445, 5204, 905, 25525, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDisableUserAccessToken(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() defer th.TearDown() Client := th.Client AdminClient := th.SystemAdminClient testDescription := "test token" *th.App.Config().ServiceSettings.EnableUserAccessTokens = true th.App.UpdateUserRoles(th.BasicUser.Id, model.SYSTEM_USER_ROLE_ID+" "+model.SYSTEM_USER_ACCESS_TOKEN_ROLE_ID, false) token, resp := Client.CreateUserAccessToken(th.BasicUser.Id, testDescription) CheckNoError(t, resp) oldSessionToken := Client.AuthToken Client.AuthToken = token.Token _, resp = Client.GetMe("") CheckNoError(t, resp) Client.AuthToken = oldSessionToken ok, resp := Client.DisableUserAccessToken(token.Id) CheckNoError(t, resp) if !ok { t.Fatal("should have passed") } oldSessionToken = Client.AuthToken Client.AuthToken = token.Token _, resp = Client.GetMe("") CheckUnauthorizedStatus(t, resp) Client.AuthToken = oldSessionToken token, resp = AdminClient.CreateUserAccessToken(th.BasicUser2.Id, testDescription) CheckNoError(t, resp) ok, resp = Client.DisableUserAccessToken(token.Id) CheckForbiddenStatus(t, resp) if ok { t.Fatal("should have failed") } }
explode_data.jsonl/21562
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 406 }
[ 2830, 3393, 25479, 1474, 37649, 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, 198, 197, 7210, 2959, 1669, 270, 16620, 7210, 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 TestListDevice(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/API/ScreenEventFGHADeviceGet", func(w http.ResponseWriter, r *http.Request) { th.TestMethod(t, r, "GET") th.TestHeader(t, r, "X-Auth-Token", fakeclient.TokenID) w.Header().Add("Content-Type", "application/json") fmt.Fprintf(w, listResponse) }) count := 0 err := security.List(fakeclient.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) { count++ actual, err := security.ExtractHADevices(page) th.AssertNoErr(t, err) th.CheckDeepEquals(t, expectedDevicesSlice, actual) return true, nil }) th.AssertNoErr(t, err) th.CheckEquals(t, 1, count) }
explode_data.jsonl/45983
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 279 }
[ 2830, 3393, 852, 6985, 1155, 353, 8840, 836, 8, 341, 70479, 39820, 9230, 741, 16867, 270, 94849, 37496, 9230, 2822, 70479, 1321, 2200, 63623, 4283, 7082, 14, 7971, 1556, 12001, 39, 1808, 63924, 1949, 497, 2915, 3622, 1758, 37508, 11, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestForBreak(t *testing.T) { const SCRIPT = ` var supreme, count; supreme = 5; var __evaluated = eval("for(count=0;;) {if (count===supreme)break;else count++; }"); if (__evaluated !== void 0) { throw new Error('#1: __evaluated === 4. Actual: __evaluated ==='+ __evaluated ); } ` testScript1(SCRIPT, _undefined, t) }
explode_data.jsonl/75310
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 146 }
[ 2830, 3393, 2461, 22524, 1155, 353, 8840, 836, 8, 341, 4777, 53679, 284, 22074, 2405, 43122, 11, 1760, 280, 1903, 454, 9634, 284, 220, 20, 280, 2405, 1304, 14170, 12852, 284, 220, 5603, 445, 1958, 11512, 28, 15, 6768, 8, 314, 333, 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 TestSetupWorkloadIdentityComponents(t *testing.T) { if AzureRunWorkloadIdentityTests == "" || AzureRunWorkloadIdentityTests == "false" { t.Skip("skipping as workload identity tests are disabled") } _, err := ExecuteCommand("helm version") require.NoErrorf(t, err, "helm is not installed - %s", err) _, err = ExecuteCommand("helm repo add azure-workload-identity https://azure.github.io/azure-workload-identity/charts") require.NoErrorf(t, err, "cannot add workload identity helm repo - %s", err) _, err = ExecuteCommand("helm repo update azure-workload-identity") require.NoErrorf(t, err, "cannot update workload identity helm repo - %s", err) Kc = GetKubernetesClient(t) CreateNamespace(t, Kc, AzureWorkloadIdentityNamespace) _, err = ExecuteCommand(fmt.Sprintf("helm upgrade --install workload-identity-webhook azure-workload-identity/workload-identity-webhook --namespace %s --set azureTenantID=%s", AzureWorkloadIdentityNamespace, AzureADTenantID)) require.NoErrorf(t, err, "cannot install workload identity webhook - %s", err) workloadIdentityDeploymentName := "azure-wi-webhook-controller-manager" success := false for i := 0; i < 20; i++ { deployment, err := Kc.AppsV1().Deployments(AzureWorkloadIdentityNamespace).Get(context.Background(), workloadIdentityDeploymentName, v1.GetOptions{}) require.NoErrorf(t, err, "unable to get workload identity webhook deployment - %s", err) readyReplicas := deployment.Status.ReadyReplicas if readyReplicas != 2 { t.Log("workload identity webhook is not ready. sleeping") time.Sleep(5 * time.Second) } else { t.Log("workload identity webhook is ready") success = true time.Sleep(2 * time.Minute) // sleep for some time for webhook to setup properly break } } require.True(t, success, "expected workload identity webhook deployment to start 2 pods successfully") }
explode_data.jsonl/1938
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 620 }
[ 2830, 3393, 21821, 6776, 1078, 18558, 10443, 1155, 353, 8840, 836, 8, 341, 743, 34119, 6727, 6776, 1078, 18558, 18200, 621, 1591, 1369, 34119, 6727, 6776, 1078, 18558, 18200, 621, 330, 3849, 1, 341, 197, 3244, 57776, 445, 4886, 5654, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 Test(t *testing.T) { t.Log("Current test is [a]") examples := [][]string{ { `23`, `"1000"`, }, { `107`, `"101100"`, }, } targetCaseNum := 0 if err := testutil.RunLeetCodeFuncWithExamples(t, encode, examples, targetCaseNum); err != nil { t.Fatal(err) } }
explode_data.jsonl/6591
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 138 }
[ 2830, 3393, 1155, 353, 8840, 836, 8, 341, 3244, 5247, 445, 5405, 1273, 374, 508, 64, 47915, 8122, 4023, 1669, 52931, 917, 515, 197, 197, 515, 298, 197, 63, 17, 18, 12892, 298, 197, 63, 1, 16, 15, 15, 15, 1, 12892, 197, 197, 1583...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPusher_addLogEvent(t *testing.T) { p, tmpFolder := newMockPusher() defer os.RemoveAll(tmpFolder) p.addLogEvent(NewLogEvent(time.Now().Add(-(14*24+1)*time.Hour).UnixNano()/1e6, msg)) assert.Equal(t, 0, len(p.logEventBatch.PutLogEventsInput.LogEvents)) assert.Equal(t, int64(0), p.logEventBatch.minTimestampInMillis) assert.Equal(t, int64(0), p.logEventBatch.maxTimestampInMillis) assert.Equal(t, 0, p.logEventBatch.byteTotal) p.addLogEvent(NewLogEvent(time.Now().Add((2+1)*time.Hour).UnixNano()/1e6, msg)) assert.Equal(t, 0, len(p.logEventBatch.PutLogEventsInput.LogEvents)) assert.Equal(t, int64(0), p.logEventBatch.minTimestampInMillis) assert.Equal(t, int64(0), p.logEventBatch.maxTimestampInMillis) assert.Equal(t, 0, p.logEventBatch.byteTotal) p.addLogEvent(NewLogEvent(timestampInMillis, "")) assert.Equal(t, 0, len(p.logEventBatch.PutLogEventsInput.LogEvents)) assert.Equal(t, int64(0), p.logEventBatch.minTimestampInMillis) assert.Equal(t, int64(0), p.logEventBatch.maxTimestampInMillis) assert.Equal(t, 0, p.logEventBatch.byteTotal) p.addLogEvent(NewLogEvent(timestampInMillis, msg)) assert.Equal(t, 1, len(p.logEventBatch.PutLogEventsInput.LogEvents)) assert.Equal(t, timestampInMillis, p.logEventBatch.minTimestampInMillis) assert.Equal(t, timestampInMillis, p.logEventBatch.maxTimestampInMillis) assert.Equal(t, len(msg)+PerEventHeaderBytes, p.logEventBatch.byteTotal) p.addLogEvent(NewLogEvent(timestampInMillis+1, msg+"1")) assert.Equal(t, 2, len(p.logEventBatch.PutLogEventsInput.LogEvents)) assert.Equal(t, timestampInMillis, p.logEventBatch.minTimestampInMillis) assert.Equal(t, timestampInMillis+1, p.logEventBatch.maxTimestampInMillis) assert.Equal(t, len(msg)+len(msg+"1")+2*PerEventHeaderBytes, p.logEventBatch.byteTotal) }
explode_data.jsonl/61463
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 736 }
[ 2830, 3393, 16644, 261, 2891, 2201, 1556, 1155, 353, 8840, 836, 8, 341, 3223, 11, 4174, 13682, 1669, 501, 11571, 16644, 261, 741, 16867, 2643, 84427, 10368, 13682, 692, 3223, 1364, 2201, 1556, 35063, 2201, 1556, 9730, 13244, 1005, 2212, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_ExecuteLIST(t *testing.T) { cmd := &command{ action: LIST, key: "foo", } ds.Add("foo", "bar") got, err := cmd.Execute() want := "map[foo:bar]" if err != nil { t.Fatal(err) } if got != want { t.Errorf("%s = %q, want %q", got, want, want) } }
explode_data.jsonl/79586
{ "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, 83453, 22852, 1155, 353, 8840, 836, 8, 341, 25920, 1669, 609, 5631, 515, 197, 38933, 25, 26966, 345, 197, 23634, 25, 262, 330, 7975, 756, 197, 630, 83336, 1904, 445, 7975, 497, 330, 2257, 5130, 3174, 354, 11, 1848, 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...
3
func TestCountMallocs(t *testing.T) { switch { case testing.Short(): t.Skip("skipping malloc count in short mode") case runtime.GOMAXPROCS(0) > 1: t.Skip("skipping; GOMAXPROCS>1") case race.Enabled: t.Skip("skipping malloc count under race detector") } for _, mt := range mallocTest { mallocs := testing.AllocsPerRun(100, mt.fn) if got, max := mallocs, float64(mt.count); got > max { t.Errorf("%s: got %v allocs, want <=%v", mt.desc, got, max) } } }
explode_data.jsonl/46258
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 199 }
[ 2830, 3393, 2507, 53681, 82, 1155, 353, 8840, 836, 8, 341, 8961, 341, 2722, 7497, 55958, 3932, 197, 3244, 57776, 445, 4886, 5654, 15731, 1760, 304, 2805, 3856, 1138, 2722, 15592, 1224, 1898, 2954, 9117, 6412, 7, 15, 8, 861, 220, 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...
6
func TestSmoke(t *testing.T) { objSizes := [3]uint64{3 * cos.KiB, 19 * cos.KiB, 77 * cos.KiB} runProviderTests(t, func(t *testing.T, bck *cluster.Bck) { for _, objSize := range objSizes { name := fmt.Sprintf("size:%s", cos.B2S(int64(objSize), 0)) t.Run(name, func(t *testing.T) { m := ioContext{ t: t, bck: bck.Clone(), num: 100, fileSize: objSize, prefix: "smoke/obj-", } if bck.IsAIS() || bck.IsRemoteAIS() { m.num = 1000 } m.initWithCleanup() m.puts() m.gets() m.del() }) } }) }
explode_data.jsonl/31627
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 329 }
[ 2830, 3393, 76880, 1155, 353, 8840, 836, 8, 341, 22671, 34930, 1669, 508, 18, 60, 2496, 21, 19, 90, 18, 353, 7960, 11352, 72, 33, 11, 220, 16, 24, 353, 7960, 11352, 72, 33, 11, 220, 22, 22, 353, 7960, 11352, 72, 33, 630, 56742, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNetworksCRUD(t *testing.T) { client, err := clients.NewNetworkV2Client() th.AssertNoErr(t, err) // Create a network network, err := CreateNetwork(t, client) th.AssertNoErr(t, err) defer DeleteNetwork(t, client, network.ID) tools.PrintResource(t, network) newName := tools.RandomString("TESTACC-", 8) newDescription := "" updateOpts := &networks.UpdateOpts{ Name: &newName, Description: &newDescription, } _, err = networks.Update(client, network.ID, updateOpts).Extract() th.AssertNoErr(t, err) newNetwork, err := networks.Get(client, network.ID).Extract() th.AssertNoErr(t, err) tools.PrintResource(t, newNetwork) th.AssertEquals(t, newNetwork.Name, newName) th.AssertEquals(t, newNetwork.Description, newDescription) type networkWithExt struct { networks.Network portsecurity.PortSecurityExt } var allNetworks []networkWithExt allPages, err := networks.List(client, nil).AllPages() th.AssertNoErr(t, err) err = networks.ExtractNetworksInto(allPages, &allNetworks) th.AssertNoErr(t, err) var found bool for _, network := range allNetworks { if network.ID == newNetwork.ID { found = true } } th.AssertEquals(t, found, true) }
explode_data.jsonl/30453
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 452 }
[ 2830, 3393, 12320, 82, 8973, 4656, 1155, 353, 8840, 836, 8, 341, 25291, 11, 1848, 1669, 8239, 7121, 12320, 53, 17, 2959, 741, 70479, 11711, 2753, 7747, 1155, 11, 1848, 692, 197, 322, 4230, 264, 3922, 198, 9038, 2349, 11, 1848, 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...
3
func TestPut(t *testing.T) { m := NewSimpleLongConcurrentHashMap() lily := Girl{"Lily"} lucy := Girl{"Lucy"} m.Put(2, lily) m.Put(3, lucy) if m.Size() != 2 { t.Error("map should contain only two elements") } }
explode_data.jsonl/19656
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 98 }
[ 2830, 3393, 19103, 1155, 353, 8840, 836, 8, 341, 2109, 1669, 1532, 16374, 6583, 1109, 3231, 18497, 2822, 262, 8810, 1541, 1669, 11363, 4913, 43, 1541, 16707, 8810, 1754, 88, 1669, 11363, 4913, 40645, 88, 63159, 2109, 39825, 7, 17, 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 TestSameConfig(t *testing.T) { a := &testFsInfo{name: "name", root: "root"} for _, test := range []struct { name string root string expected bool }{ {"name", "root", true}, {"name", "rooty", true}, {"namey", "root", false}, {"namey", "roott", false}, } { b := &testFsInfo{name: test.name, root: test.root} actual := operations.SameConfig(a, b) assert.Equal(t, test.expected, actual) actual = operations.SameConfig(b, a) assert.Equal(t, test.expected, actual) } }
explode_data.jsonl/51946
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 207 }
[ 2830, 3393, 19198, 2648, 1155, 353, 8840, 836, 8, 341, 11323, 1669, 609, 1944, 48300, 1731, 47006, 25, 330, 606, 497, 3704, 25, 330, 2888, 16707, 2023, 8358, 1273, 1669, 2088, 3056, 1235, 341, 197, 11609, 257, 914, 198, 197, 33698, 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...
2
func TestUnresolvedRecursiveStruct(t *testing.T) { // struct A { // a: A // b: Cycle<1> (unresolved) // } a := MakeStructType("A", StructField{"a", MakeCycleType("A"), false}, StructField{"b", MakeCycleType("X"), false}, ) assertWriteHRSEqual(t, `Struct A { a: Cycle<A>, b: UnresolvedCycle<X>, }`, a) }
explode_data.jsonl/60906
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 138 }
[ 2830, 3393, 1806, 39747, 78542, 9422, 1155, 353, 8840, 836, 8, 341, 197, 322, 2036, 362, 341, 197, 322, 256, 264, 25, 362, 198, 197, 322, 256, 293, 25, 41292, 27, 16, 29, 320, 359, 39747, 340, 197, 322, 456, 11323, 1669, 7405, 942...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetBody(t *testing.T) { body := []interface{}{testMessage} bodyBytes := new(bytes.Buffer) errJson := json.NewEncoder(bodyBytes).Encode(&body) if errJson != nil { t.Fail() t.Logf(errJson.Error()) return } req, errReq := http.NewRequest("POST", "/", bodyBytes) if errReq != nil { t.Fail() t.Logf(errReq.Error()) return } reqBody, errReqBody := getBody(req, nil) if errReqBody != nil { t.Fail() t.Logf(fmt.Sprint("expected an array, ", errReqBody.Error())) return } if reqBody == nil { t.Fail() t.Logf(fmt.Sprint("request body is nil")) return } }
explode_data.jsonl/48436
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 259 }
[ 2830, 3393, 1949, 5444, 1155, 353, 8840, 836, 8, 341, 35402, 1669, 3056, 4970, 6257, 90, 1944, 2052, 532, 35402, 7078, 1669, 501, 23158, 22622, 340, 9859, 5014, 1669, 2951, 7121, 19921, 15225, 7078, 568, 32535, 2099, 2599, 340, 743, 184...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTransportBodyDoubleEndStream(t *testing.T) { st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { // Nothing. }, optOnlyServer) defer st.Close() tr := &Transport{TLSClientConfig: tlsConfigInsecure} defer tr.CloseIdleConnections() for i := 0; i < 2; i++ { req, _ := http.NewRequest("POST", st.ts.URL, byteAndEOFReader('a')) req.ContentLength = 1 res, err := tr.RoundTrip(req) if err != nil { t.Fatalf("failure on req %d: %v", i+1, err) } defer res.Body.Close() } }
explode_data.jsonl/16131
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 214 }
[ 2830, 3393, 27560, 5444, 7378, 3727, 3027, 1155, 353, 8840, 836, 8, 341, 18388, 1669, 501, 5475, 58699, 1155, 11, 2915, 3622, 1758, 37508, 11, 435, 353, 1254, 9659, 8, 341, 197, 197, 322, 12064, 624, 197, 2137, 3387, 7308, 5475, 340, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestHTTPHandlerWrapper(t *testing.T) { d := NewMux() d.Register(func(ctx context.Context, m *httpEcho) error { m.Result.Text = m.Text return nil }) encoder := func(w http.ResponseWriter, r *http.Request, v interface{}) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") if err, ok := v.(error); ok { v = struct { Error string `json:"error"` }{err.Error()} w.WriteHeader(500) } return json.NewEncoder(w).Encode(v) } decoder := func(r *http.Request, v interface{}) error { return json.NewDecoder(r.Body).Decode(v) } const result = "Result" t.Run("Nil Dispatcher", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Encoder: encoder, Decoder: decoder, Result: result, } assert.Panics(t, func() { wrapper.Handler(new(httpEcho)) }) }) t.Run("Nil Encoder", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Decoder: decoder, Result: result, } assert.Panics(t, func() { wrapper.Handler(new(httpEcho)) }) }) t.Run("Nil Decoder", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Result: result, } assert.Panics(t, func() { wrapper.Handler(new(httpEcho)) }) }) t.Run("Empty Result", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: decoder, } assert.Panics(t, func() { wrapper.Handler(new(httpEcho)) }) }) t.Run("Invalid Message", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: decoder, Result: result, } assert.Panics(t, func() { wrapper.Handler(TestHTTPHandlerWrapper) }) }) t.Run("Result Not Found", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: decoder, Result: result, } assert.Panics(t, func() { wrapper.Handler(new(httpNoResult)) }) }) t.Run("Success", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: decoder, Result: result, } h := wrapper.Handler(new(httpEcho)) if assert.NotNil(t, h) { r := httptest.NewRequest("POST", "/", strings.NewReader(`{"text":"hello"}`)) w := httptest.NewRecorder() h.ServeHTTP(w, r) assert.JSONEq(t, `{"text":"hello"}`, w.Body.String()) } }) t.Run("Decode Error", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: func(r *http.Request, v interface{}) error { return fmt.Errorf("decode error") }, Result: result, } h := wrapper.Handler(new(httpEcho)) if assert.NotNil(t, h) { r := httptest.NewRequest("POST", "/", strings.NewReader(`{"text":"hello"}`)) w := httptest.NewRecorder() h.ServeHTTP(w, r) assert.EqualValues(t, 500, w.Code) assert.JSONEq(t, `{"error":"decode error"}`, w.Body.String()) } }) t.Run("Dispatch Error", func(t *testing.T) { d := NewMux() d.Register(func(ctx context.Context, m *httpEcho) error { return fmt.Errorf("dispatch error") }) wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: encoder, Decoder: decoder, Result: result, } h := wrapper.Handler(new(httpEcho)) if assert.NotNil(t, h) { r := httptest.NewRequest("POST", "/", strings.NewReader(`{"text":"hello"}`)) w := httptest.NewRecorder() h.ServeHTTP(w, r) assert.EqualValues(t, 500, w.Code) assert.JSONEq(t, `{"error":"dispatch error"}`, w.Body.String()) } }) t.Run("Encode Error", func(t *testing.T) { wrapper := HTTPHandlerWrapper{ Dispatcher: d, Encoder: func(w http.ResponseWriter, r *http.Request, v interface{}) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") if err, ok := v.(error); ok { v = struct { Error string `json:"error"` }{err.Error()} w.WriteHeader(500) return json.NewEncoder(w).Encode(v) } return fmt.Errorf("encode error") }, Decoder: decoder, Result: result, } h := wrapper.Handler(new(httpEcho)) if assert.NotNil(t, h) { r := httptest.NewRequest("POST", "/", strings.NewReader(`{"text":"hello"}`)) w := httptest.NewRecorder() h.ServeHTTP(w, r) assert.EqualValues(t, 500, w.Code) assert.JSONEq(t, `{"error":"encode error"}`, w.Body.String()) } }) }
explode_data.jsonl/28513
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1917 }
[ 2830, 3393, 9230, 3050, 11542, 1155, 353, 8840, 836, 8, 341, 2698, 1669, 1532, 44, 2200, 2822, 2698, 19983, 18552, 7502, 2266, 9328, 11, 296, 353, 1254, 74994, 8, 1465, 341, 197, 2109, 18456, 1979, 284, 296, 1979, 198, 197, 853, 2092,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestX509KeyPair(t *testing.T) { cs := cryptosuite.GetDefault() // Not a cert _, err := X509KeyPair([]byte(""), nil, cs) if err == nil { t.Fatal("Should have failed for not a cert") } // Malformed cert _, err = X509KeyPair([]byte(malformedCert), nil, cs) if err == nil { t.Fatal("Should have failed for malformed cert") } // DSA Cert _, err = X509KeyPair([]byte(dsa2048), nil, cs) if err == nil { t.Fatal("Should have failed for DSA algorithm") } // ECSDA Cert _, err = X509KeyPair([]byte(ecdsaCert), nil, cs) if err != nil { t.Fatalf("Failed to load key pair: %s", err) } // RSA Cert _, err = X509KeyPair([]byte(rsaCert), nil, cs) if err != nil { t.Fatalf("Failed to load key pair: %s", err) } }
explode_data.jsonl/31223
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 312 }
[ 2830, 3393, 55, 20, 15, 24, 1592, 12443, 1155, 353, 8840, 836, 8, 1476, 71899, 1669, 14436, 436, 9302, 2234, 3675, 2822, 197, 322, 2806, 264, 2777, 198, 197, 6878, 1848, 1669, 1599, 20, 15, 24, 1592, 12443, 10556, 3782, 86076, 2092, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServerRebuild(t *testing.T) { setup() defer teardown() var svr *server mux.HandleFunc(testlib.CloudServerURL(svr.itemActionPath("5767c20e-fba4-4b23-8045-31e641d10d57")), func(w http.ResponseWriter, r *http.Request) { assert.Equal(t, http.MethodPost, r.Method) var sa *ServerAction require.NoError(t, json.NewDecoder(r.Body).Decode(&sa)) assert.Equal(t, "rebuild", sa.Action) assert.Equal(t, "263457d0-7e40-11ea-99fe-3b298a7e3e62", sa.ImageID) resp := ` { "task_id": "f188d844-7e3f-11ea-a878-17c5949416eb" } ` _, _ = fmt.Fprint(w, resp) }) task, err := client.Server.Rebuild(ctx, "5767c20e-fba4-4b23-8045-31e641d10d57", "263457d0-7e40-11ea-99fe-3b298a7e3e62") require.NoError(t, err) assert.Equal(t, "f188d844-7e3f-11ea-a878-17c5949416eb", task.TaskID) }
explode_data.jsonl/35477
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 396 }
[ 2830, 3393, 5475, 693, 5834, 1155, 353, 8840, 836, 8, 341, 84571, 741, 16867, 49304, 741, 2405, 13559, 81, 353, 4030, 198, 2109, 2200, 63623, 8623, 2740, 94492, 5475, 3144, 1141, 18920, 8984, 2512, 1820, 445, 20, 22, 21, 22, 66, 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 TestRWFileHandleFlushRead(t *testing.T) { _, _, fh, cleanup := rwHandleCreateReadOnly(t) defer cleanup() // Check Flush does nothing if read not called err := fh.Flush() assert.NoError(t, err) assert.False(t, fh.closed) // Read data buf := make([]byte, 256) n, err := fh.Read(buf) assert.True(t, err == io.EOF || err == nil) assert.Equal(t, 16, n) // Check Flush does nothing if read called err = fh.Flush() assert.NoError(t, err) assert.False(t, fh.closed) // Check flush does nothing if called again err = fh.Flush() assert.NoError(t, err) assert.False(t, fh.closed) // Properly close the file assert.NoError(t, fh.Close()) }
explode_data.jsonl/7341
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 262 }
[ 2830, 3393, 56368, 1703, 6999, 46874, 4418, 1155, 353, 8840, 836, 8, 341, 197, 6878, 8358, 36075, 11, 21290, 1669, 25991, 6999, 4021, 20914, 1155, 340, 16867, 21290, 2822, 197, 322, 4248, 57626, 1558, 4302, 421, 1349, 537, 2598, 198, 98...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestProvider(t *testing.T) { p := Provider{ []string{"one", "three"}, func(_ ...Option) (Pusher, error) { return nil, nil }, } if !p.Provides("three") { t.Error("Expected provider to provide three") } }
explode_data.jsonl/54517
{ "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, 5179, 1155, 353, 8840, 836, 8, 341, 3223, 1669, 22916, 515, 197, 197, 1294, 917, 4913, 603, 497, 330, 27856, 7115, 197, 29244, 2490, 2503, 5341, 8, 320, 16644, 261, 11, 1465, 8, 314, 470, 2092, 11, 2092, 1153, 197, 630, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestParseAssignmentStatementSingleConstant(t *testing.T) { p, _ := ParseString("x = 6") bvmUtils.AssertNow(t, p != nil, "scope is nil") bvmUtils.AssertLength(t, len(p.Sequence), 1) first := p.Next() bvmUtils.AssertNow(t, first.Type() == ast.AssignmentStatement, "Asteroid Errors: Node Error: Wrong node type. ") assignmentStmt := first.(*ast.AssignmentStatementNode) bvmUtils.AssertNow(t, len(assignmentStmt.Left) == 1, "wrong left length") bvmUtils.AssertNow(t, len(assignmentStmt.Right) == 1, "wrong right length") left := assignmentStmt.Left[0] right := assignmentStmt.Right[0] bvmUtils.AssertNow(t, left != nil, "left is nil") bvmUtils.AssertNow(t, left.Type() == ast.Identifier, "wrong left type") bvmUtils.AssertNow(t, right != nil, "right is nil") bvmUtils.AssertNow(t, right.Type() == ast.Literal, "wrong right type") }
explode_data.jsonl/49708
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 327 }
[ 2830, 3393, 14463, 41613, 8636, 10888, 15472, 1155, 353, 8840, 836, 8, 341, 3223, 11, 716, 1669, 14775, 703, 445, 87, 284, 220, 21, 1138, 2233, 7338, 4209, 11711, 7039, 1155, 11, 281, 961, 2092, 11, 330, 4186, 374, 2092, 1138, 2233, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestToSnakeCase(t *testing.T) { Convey("toSnakeCase should transform camelcase to snake case", t, func() { cases := [][]string{ {"Test", "test"}, {"ParseBQL", "parse_bql"}, {"B2B", "b_2_b"}, } for _, c := range cases { So(toSnakeCase(c[0]), ShouldEqual, c[1]) } }) }
explode_data.jsonl/44427
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 132 }
[ 2830, 3393, 1249, 83420, 4207, 1155, 353, 8840, 836, 8, 341, 93070, 5617, 445, 983, 83420, 4207, 1265, 5165, 49152, 5638, 311, 25265, 1142, 497, 259, 11, 2915, 368, 341, 197, 1444, 2264, 1669, 52931, 917, 515, 298, 197, 4913, 2271, 49...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPacketDot11CtrlCTS(t *testing.T) { p := gopacket.NewPacket(testPacketDot11CtrlCTS, LinkTypeIEEE80211Radio, gopacket.Default) if p.ErrorLayer() != nil { t.Error("Failed to decode packet:", p.ErrorLayer().Error()) } checkLayers(p, []gopacket.LayerType{LayerTypeRadioTap, LayerTypeDot11}, t) if got, ok := p.Layer(LayerTypeRadioTap).(*RadioTap); ok { want := &RadioTap{ BaseLayer: BaseLayer{ Contents: []uint8{0x0, 0x0, 0x19, 0x0, 0x6f, 0x8, 0x0, 0x0, 0x37, 0x68, 0x3a, 0x1, 0x0, 0x0, 0x0, 0x0, 0x12, 0x30, 0x78, 0x14, 0x40, 0x1, 0xb1, 0xa4, 0x1}, Payload: []uint8{0xc4, 0x0, 0x94, 0x0, 0xd8, 0xa2, 0x5e, 0x97, 0x61, 0xc1, 0x36, 0x50, 0x95, 0x8e}, }, Version: 0x0, Length: 0x19, Present: 0x86f, TSFT: 0x13a6837, Flags: 0x12, Rate: 0x30, ChannelFrequency: 0x1478, ChannelFlags: 0x140, FHSS: 0x0, DBMAntennaSignal: -79, DBMAntennaNoise: -92, LockQuality: 0x0, TxAttenuation: 0x0, DBTxAttenuation: 0x0, DBMTxPower: 0, Antenna: 1, DBAntennaSignal: 0x0, DBAntennaNoise: 0x0, } if !reflect.DeepEqual(got, want) { t.Errorf("RadioTap packet processing failed:\ngot :\n%#v\n\nwant :\n%#v\n\n", got, want) } } if got, ok := p.Layer(LayerTypeDot11).(*Dot11); ok { if !got.ChecksumValid() { t.Errorf("Dot11 packet processing failed:\nchecksum failed. got :\n%#v\n\n", got) } want := &Dot11{ BaseLayer: BaseLayer{ Contents: []uint8{0xc4, 0x0, 0x94, 0x0, 0xd8, 0xa2, 0x5e, 0x97, 0x61, 0xc1}, Payload: []uint8{}, }, Type: Dot11TypeCtrlCTS, Proto: 0x0, Flags: 0x0, DurationID: 0x94, Address1: net.HardwareAddr{0xd8, 0xa2, 0x5e, 0x97, 0x61, 0xc1}, // check Address2: net.HardwareAddr(nil), Address3: net.HardwareAddr(nil), Address4: net.HardwareAddr(nil), Checksum: 0x8e955036, } if !reflect.DeepEqual(got, want) { t.Errorf("Dot11 packet processing failed:\ngot :\n%#v\n\nwant :\n%#v\n\n", got, want) } } }
explode_data.jsonl/7560
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1156 }
[ 2830, 3393, 16679, 34207, 16, 16, 15001, 94737, 1155, 353, 8840, 836, 8, 341, 3223, 1669, 342, 453, 5709, 7121, 16679, 8623, 16679, 34207, 16, 16, 15001, 94737, 11, 5948, 929, 76705, 23, 15, 17, 16, 16, 28203, 11, 342, 453, 5709, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetRecentTrades(t *testing.T) { t.Parallel() currencyPair, err := currency.NewPairFromString("BTCUSDT") if err != nil { t.Fatal(err) } _, err = b.GetRecentTrades(context.Background(), currencyPair, asset.Spot) if err != nil { t.Error(err) } }
explode_data.jsonl/76695
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 110 }
[ 2830, 3393, 1949, 25140, 1282, 3452, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 1444, 5088, 12443, 11, 1848, 1669, 11413, 7121, 12443, 44491, 445, 59118, 2034, 10599, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 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...
3
func TestSumPerKeyReturnsNonNegativeInt64(t *testing.T) { var triples []testutils.TripleWithIntValue for key := 0; key < 100; key++ { triples = append(triples, testutils.TripleWithIntValue{key, key, 1}) } p, s, col := ptest.CreateList(triples) col = beam.ParDo(s, testutils.ExtractIDFromTripleWithIntValue, col) // Using a low epsilon, a high delta, and a high maxValue here to add a // lot of noise while keeping partitions. epsilon, delta, maxValue := 0.001, 0.999, 1e8 pcol := MakePrivate(s, col, NewPrivacySpec(epsilon, delta)) pcol = ParDo(s, testutils.TripleWithIntValueToKV, pcol) sums := SumPerKey(s, pcol, SumParams{MinValue: 0, MaxValue: maxValue, MaxPartitionsContributed: 1, NoiseKind: GaussianNoise{}}) values := beam.DropKey(s, sums) beam.ParDo0(s, testutils.CheckNoNegativeValuesInt64Fn, values) if err := ptest.Run(p); err != nil { t.Errorf("TestSumPerKeyReturnsNonNegativeInt64 returned errors: %v", err) } }
explode_data.jsonl/42977
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 353 }
[ 2830, 3393, 9190, 3889, 1592, 16446, 8121, 38489, 1072, 21, 19, 1155, 353, 8840, 836, 8, 341, 2405, 88561, 3056, 1944, 6031, 836, 461, 694, 2354, 1072, 1130, 198, 2023, 1376, 1669, 220, 15, 26, 1376, 366, 220, 16, 15, 15, 26, 1376, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestByteReader_AddSeqIndentAnnotation(t *testing.T) { type testCase struct { name string err string input string expectedAnnoValue string OmitReaderAnnotations bool } testCases := []testCase{ { name: "read with wide indentation", input: `apiVersion: apps/v1 kind: Deployment spec: - foo - bar - baz `, expectedAnnoValue: "wide", }, { name: "read with compact indentation", input: `apiVersion: apps/v1 kind: Deployment spec: - foo - bar - baz `, expectedAnnoValue: "compact", }, { name: "read with mixed indentation, wide wins", input: `apiVersion: apps/v1 kind: Deployment spec: - foo - bar - baz env: - foo - bar `, expectedAnnoValue: "wide", }, { name: "read with mixed indentation, compact wins", input: `apiVersion: apps/v1 kind: Deployment spec: - foo - bar - baz env: - foo - bar `, expectedAnnoValue: "compact", }, { name: "error if conflicting options", input: `apiVersion: apps/v1 kind: Deployment spec: - foo - bar - baz env: - foo - bar `, OmitReaderAnnotations: true, err: `"PreserveSeqIndent" option adds a reader annotation, please set "OmitReaderAnnotations" to false`, }, } for i := range testCases { tc := testCases[i] t.Run(tc.name, func(t *testing.T) { rNodes, err := (&ByteReader{ OmitReaderAnnotations: tc.OmitReaderAnnotations, PreserveSeqIndent: true, Reader: bytes.NewBuffer([]byte(tc.input)), }).Read() if tc.err != "" { assert.Error(t, err) assert.Equal(t, tc.err, err.Error()) return } assert.NoError(t, err) actual := rNodes[0].GetAnnotations()[kioutil.SeqIndentAnnotation] assert.Equal(t, tc.expectedAnnoValue, actual) }) } }
explode_data.jsonl/53079
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 819 }
[ 2830, 3393, 7153, 5062, 21346, 20183, 42729, 19711, 1155, 353, 8840, 836, 8, 341, 13158, 54452, 2036, 341, 197, 11609, 1698, 914, 198, 197, 9859, 4293, 914, 198, 197, 22427, 338, 914, 198, 197, 42400, 2082, 2152, 1130, 257, 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 TestClient_SetPkgLogLevel(t *testing.T) { t.Parallel() app := startNewApplication(t) client, _ := app.NewClientAndRenderer() logPkg := logger.HeadTracker logLevel := "warn" set := flag.NewFlagSet("logpkg", 0) set.String("pkg", logPkg, "") set.String("level", logLevel, "") c := cli.NewContext(nil, set, nil) err := client.SetLogPkg(c) require.NoError(t, err) level, ok := logger.NewORM(app.GetSqlxDB(), logger.TestLogger(t)).GetServiceLogLevel(logPkg) require.True(t, ok) assert.Equal(t, logLevel, level) }
explode_data.jsonl/5279
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 212 }
[ 2830, 3393, 2959, 14812, 47, 7351, 72676, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 28236, 1669, 1191, 3564, 4988, 1155, 340, 25291, 11, 716, 1669, 906, 7121, 2959, 3036, 11541, 2822, 6725, 47, 7351, 1669, 5925, 90478, 3113...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRateBreakerResets(t *testing.T) { serviceError := fmt.Errorf("service error") called := 0 success := false circuit := func() error { if called < 4 { called++ return serviceError } success = true return nil } c := clock.NewMock() cb := NewRateBreaker(0.5, 4) cb.Clock = c var err error for i := 0; i < 4; i++ { err = cb.Call(circuit, 0) if err == nil { t.Fatal("Expected cb to return an error (closed breaker, service failure)") } else if err != serviceError { t.Fatal("Expected cb to return error from service (closed breaker, service failure)") } } err = cb.Call(circuit, 0) if err == nil { t.Fatal("Expected cb to return an error (open breaker)") } else if err != ErrBreakerOpen { t.Fatal("Expected cb to return open open breaker error (open breaker)") } c.Add(cb.nextBackOff + 1) err = cb.Call(circuit, 0) if err != nil { t.Fatal("Expected cb to be successful") } if !success { t.Fatal("Expected cb to have been reset") } }
explode_data.jsonl/60808
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 391 }
[ 2830, 3393, 11564, 22524, 261, 1061, 1415, 1155, 353, 8840, 836, 8, 341, 52934, 1454, 1669, 8879, 13080, 445, 7936, 1465, 5130, 1444, 4736, 1669, 220, 15, 198, 30553, 1669, 895, 198, 1444, 37268, 1669, 2915, 368, 1465, 341, 197, 743, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEnv(t *testing.T) { initJSON() BindEnv("id") BindEnv("f", "FOOD") os.Setenv("ID", "13") os.Setenv("FOOD", "apple") os.Setenv("NAME", "crunk") assert.Equal(t, "13", Get("id")) assert.Equal(t, "apple", Get("f")) assert.Equal(t, "Cake", Get("name")) AutomaticEnv() assert.Equal(t, "crunk", Get("name")) }
explode_data.jsonl/5557
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 151 }
[ 2830, 3393, 14359, 1155, 353, 8840, 836, 8, 341, 28248, 5370, 2822, 197, 9950, 14359, 445, 307, 1138, 197, 9950, 14359, 445, 69, 497, 330, 3788, 2069, 5130, 25078, 4202, 3160, 445, 915, 497, 330, 16, 18, 1138, 25078, 4202, 3160, 445, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAddRuntimeAnnotations(t *testing.T) { assert := assert.New(t) config := vc.SandboxConfig{ Annotations: make(map[string]string), } ocispec := specs.Spec{ Annotations: make(map[string]string), } ocispec.Annotations[vcAnnotations.DisableGuestSeccomp] = "true" ocispec.Annotations[vcAnnotations.SandboxCgroupOnly] = "true" ocispec.Annotations[vcAnnotations.DisableNewNetNs] = "true" ocispec.Annotations[vcAnnotations.InterNetworkModel] = "macvtap" addAnnotations(ocispec, &config) assert.Equal(config.DisableGuestSeccomp, true) assert.Equal(config.SandboxCgroupOnly, true) assert.Equal(config.NetworkConfig.DisableNewNetNs, true) assert.Equal(config.NetworkConfig.InterworkingModel, vc.NetXConnectMacVtapModel) }
explode_data.jsonl/44056
{ "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, 2212, 15123, 21418, 1155, 353, 8840, 836, 8, 341, 6948, 1669, 2060, 7121, 1155, 692, 25873, 1669, 24553, 808, 31536, 2648, 515, 197, 197, 21418, 25, 1281, 9147, 14032, 30953, 1326, 197, 630, 197, 509, 285, 992, 1669, 32247, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestProcessKeyVals(t *testing.T) { tests := []struct { processAttrs map[string]pdata.AttributeValue svc string cfg AutomaticLoggingConfig expected []interface{} }{ { expected: []interface{}{ "svc", "", }, }, { processAttrs: map[string]pdata.AttributeValue{ "xstr": pdata.NewAttributeValueString("test"), }, expected: []interface{}{ "svc", "", }, }, { processAttrs: map[string]pdata.AttributeValue{ "xstr": pdata.NewAttributeValueString("test"), }, cfg: AutomaticLoggingConfig{ ProcessAttributes: []string{"xstr"}, }, expected: []interface{}{ "svc", "", "xstr", "test", }, }, } for _, tc := range tests { tc.cfg.Backend = BackendStdout tc.cfg.Spans = true p, err := newTraceProcessor(&automaticLoggingProcessor{}, &tc.cfg) require.NoError(t, err) process := pdata.NewResource() pdata.NewAttributeMapFromMap(tc.processAttrs).Sort().CopyTo(process.Attributes()) actual := p.(*automaticLoggingProcessor).processKeyVals(process, tc.svc) assert.Equal(t, tc.expected, actual) } }
explode_data.jsonl/73349
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 472 }
[ 2830, 3393, 7423, 1592, 52452, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 53314, 53671, 2415, 14032, 60, 57796, 33775, 1130, 198, 197, 1903, 7362, 688, 914, 198, 197, 50286, 688, 33981, 34575, 2648, 198, 197, 42400...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLoadCAPool(t *testing.T) { caPool, err := loadCAPool(CACertPath) if err != nil { t.Error("Expected no errors loading CA cert fixutre, got", err) } if reflect.TypeOf(caPool) != reflect.TypeOf(&x509.CertPool{}) { t.Errorf("loadCAPool() returned invalid type, got %T", caPool) } _, defErr := loadCAPool("fake/cert/path") if defErr == nil { t.Error("Expected error with bad path, got", defErr) } }
explode_data.jsonl/3852
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 164 }
[ 2830, 3393, 5879, 31400, 1749, 1155, 353, 8840, 836, 8, 341, 197, 924, 10551, 11, 1848, 1669, 2795, 31400, 1749, 3025, 1706, 529, 1820, 692, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 445, 18896, 902, 5975, 8277, 9183, 2777, 5046, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSetAndGet(t *testing.T) { if value, ok := DB.Set("hello", "world").Get("hello"); !ok { t.Errorf("Should be able to get setting after set") } else { if value.(string) != "world" { t.Errorf("Setted value should not be changed") } } if _, ok := DB.Get("non_existing"); ok { t.Errorf("Get non existing key should return error") } }
explode_data.jsonl/28061
{ "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, 1649, 97726, 1155, 353, 8840, 836, 8, 341, 743, 897, 11, 5394, 1669, 5952, 4202, 445, 14990, 497, 330, 14615, 1827, 1949, 445, 14990, 5038, 753, 562, 341, 197, 3244, 13080, 445, 14996, 387, 2952, 311, 633, 6243, 1283, 738,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFindSourceController(t *testing.T) { ctrl1 := api.ReplicationController{ ObjectMeta: api.ObjectMeta{ Name: "foo", Annotations: map[string]string{ sourceIdAnnotation: "bar:1234", }, }, } ctrl2 := api.ReplicationController{ ObjectMeta: api.ObjectMeta{ Name: "bar", Annotations: map[string]string{ sourceIdAnnotation: "foo:12345", }, }, } ctrl3 := api.ReplicationController{ ObjectMeta: api.ObjectMeta{ Annotations: map[string]string{ sourceIdAnnotation: "baz:45667", }, }, } tests := []struct { list *api.ReplicationControllerList expectedController *api.ReplicationController err error name string expectError bool }{ { list: &api.ReplicationControllerList{}, expectError: true, }, { list: &api.ReplicationControllerList{ Items: []api.ReplicationController{ctrl1}, }, name: "foo", expectError: true, }, { list: &api.ReplicationControllerList{ Items: []api.ReplicationController{ctrl1}, }, name: "bar", expectedController: &ctrl1, }, { list: &api.ReplicationControllerList{ Items: []api.ReplicationController{ctrl1, ctrl2}, }, name: "bar", expectedController: &ctrl1, }, { list: &api.ReplicationControllerList{ Items: []api.ReplicationController{ctrl1, ctrl2}, }, name: "foo", expectedController: &ctrl2, }, { list: &api.ReplicationControllerList{ Items: []api.ReplicationController{ctrl1, ctrl2, ctrl3}, }, name: "baz", expectedController: &ctrl3, }, } for _, test := range tests { fakeClient := testclient.NewSimpleFake(test.list) ctrl, err := FindSourceController(fakeClient, "default", test.name) if test.expectError && err == nil { t.Errorf("unexpected non-error") } if !test.expectError && err != nil { t.Errorf("unexpected error") } if !reflect.DeepEqual(ctrl, test.expectedController) { t.Errorf("expected:\n%v\ngot:\n%v\n", test.expectedController, ctrl) } } }
explode_data.jsonl/52535
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 935 }
[ 2830, 3393, 9885, 3608, 2051, 1155, 353, 8840, 836, 8, 341, 84381, 16, 1669, 6330, 2817, 79, 1693, 2051, 515, 197, 23816, 12175, 25, 6330, 80222, 515, 298, 21297, 25, 330, 7975, 756, 298, 197, 21418, 25, 2415, 14032, 30953, 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...
7
func TestConstraints_Parse(t *testing.T) { tests := []struct { in string out Constraints err error }{ {"512:1KB", Constraints{512, 1024, 0}, nil}, {"512:1KB:nproc=512", Constraints{512, 1024, 512}, nil}, {"2048:1KB:nproc=512", Constraints{2048, 1024, 512}, nil}, {"0:1KB", Constraints{}, ErrInvalidCPUShare}, {"1024", Constraints{}, ErrInvalidConstraint}, {"1024:1KB:nproc", Constraints{}, ErrInvalidConstraint}, {"1024:1KB:nporc=512", Constraints{}, ErrInvalidConstraint}, } for i, tt := range tests { c, err := Parse(tt.in) if err != tt.err { t.Fatalf("#%d: err => %v; want %v", i, err, tt.err) } if tt.err != nil { continue } if got, want := c, tt.out; got != want { t.Fatalf("#%d: Constraints => %v; want %v", i, got, want) } } }
explode_data.jsonl/64519
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 356 }
[ 2830, 3393, 12925, 77337, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 17430, 220, 914, 198, 197, 13967, 87473, 198, 197, 9859, 1465, 198, 197, 59403, 197, 197, 4913, 20, 16, 17, 25, 16, 29862, 497, 87473, 90, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEvalFunctionExpr(t *testing.T) { const SCRIPT = ` eval("(function F() {return 42;})")() ` testScript1(SCRIPT, intToValue(42), t) }
explode_data.jsonl/75258
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 59 }
[ 2830, 3393, 54469, 5152, 16041, 1155, 353, 8840, 836, 8, 341, 4777, 53679, 284, 22074, 93413, 31732, 1688, 434, 368, 314, 689, 220, 19, 17, 26, 5410, 899, 741, 197, 19324, 18185, 5910, 16, 7, 24787, 11, 526, 1249, 1130, 7, 19, 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
func TestRenameLabelsNoBundle(t *testing.T) { default_suite.expectBundled(t, bundled{ files: map[string]string{ "/entry.js": ` foo: { bar: { if (x) break bar break foo } } foo2: { bar2: { if (x) break bar2 break foo2 } } foo: { bar: { if (x) break bar break foo } } `, }, entryPaths: []string{"/entry.js"}, options: config.Options{ AbsOutputFile: "/out.js", }, }) }
explode_data.jsonl/38537
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 271 }
[ 2830, 3393, 88757, 23674, 2753, 8409, 1155, 353, 8840, 836, 8, 341, 11940, 57239, 25952, 33, 1241, 832, 1155, 11, 51450, 515, 197, 74075, 25, 2415, 14032, 30953, 515, 298, 197, 3115, 4085, 2857, 788, 22074, 571, 197, 7975, 25, 341, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestToBytes(t *testing.T) { t.Run("Invalid ID GUID", func(t *testing.T) { partition := Partition{ Start: 2048, End: 3048, Name: "EFI System", GUID: "5CA3360B", Attributes: 0, Type: EFISystemPartition, } b, err := partition.toBytes() if b != nil { t.Error("should return nil bytes") } if err == nil { t.Error("should not return nil error") } expected := fmt.Sprintf("Unable to parse partition identifier GUID") if !strings.HasPrefix(err.Error(), expected) { t.Errorf("Error type %s instead of expected %s", err.Error(), expected) } }) t.Run("Invalid Type GUID", func(t *testing.T) { partition := Partition{ Start: 2048, End: 3048, Name: "EFI System", GUID: "5CA3360B-5DE6-4FCF-B4CE-419CEE433B51", Attributes: 0, Type: "ABCDEF", } b, err := partition.toBytes() if b != nil { t.Error("should return nil bytes") } if err == nil { t.Error("should not return nil error") } expected := fmt.Sprintf("Unable to parse partition type GUID") if !strings.HasPrefix(err.Error(), expected) { t.Errorf("Error type %s instead of expected %s", err.Error(), expected) } }) t.Run("too long name", func(t *testing.T) { partition := Partition{ Start: 2048, End: 3048, Name: "This is a very long name, as long as it is longer than 36 unicode character points, it should fail. Since that is 72 bytes, we are going to make it >72 chars.", GUID: "5CA3360B-5DE6-4FCF-B4CE-419CEE433B51", Attributes: 0, Type: EFISystemPartition, } b, err := partition.toBytes() if b != nil { t.Error("should return nil bytes") } if err == nil { t.Error("should not return nil error") } expected := fmt.Sprintf("Cannot use %s as partition name, has %d Unicode code units, maximum size is 36", partition.Name, len(partition.Name)) if !strings.HasPrefix(err.Error(), expected) { t.Errorf("Error type %s instead of expected %s", err.Error(), expected) } }) t.Run("Valid partition", func(t *testing.T) { partition := Partition{ Start: 2048, End: 3048, Name: "EFI System", GUID: "5CA3360B-5DE6-4FCF-B4CE-419CEE433B51", Attributes: 0, Type: EFISystemPartition, } b, err := partition.toBytes() if b == nil { t.Error("should not return nil bytes") } if err != nil { t.Error("should return nil error") } expected, err := ioutil.ReadFile(gptPartitionFile) if err != nil { t.Fatalf("Unable to read test fixture file %s: %v", gptPartitionFile, err) } if bytes.Compare(expected, b) != 0 { t.Errorf("returned byte %v instead of expected %v", b, expected) } }) }
explode_data.jsonl/39144
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1192 }
[ 2830, 3393, 1249, 7078, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 7928, 3034, 30221, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 72872, 680, 1669, 54626, 515, 298, 65999, 25, 414, 220, 17, 15, 19, 23, 345, 298, 38407, 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...
4
func TestParallelism(t *testing.T) { cancel, controller := newController( unmarshalWF(` metadata: name: my-wf-0 spec: entrypoint: main templates: - name: main container: image: my-image `), unmarshalWF(` metadata: name: my-wf-1 spec: entrypoint: main templates: - name: main container: image: my-image `), func(controller *WorkflowController) { controller.Config.Parallelism = 1 }, ) defer cancel() ctx := context.Background() assert.True(t, controller.processNextItem(ctx)) assert.True(t, controller.processNextItem(ctx)) expectWorkflow(ctx, controller, "my-wf-0", func(wf *wfv1.Workflow) { if assert.NotNil(t, wf) { assert.Equal(t, wfv1.WorkflowRunning, wf.Status.Phase) } }) expectWorkflow(ctx, controller, "my-wf-1", func(wf *wfv1.Workflow) { if assert.NotNil(t, wf) { assert.Empty(t, wf.Status.Phase) } }) }
explode_data.jsonl/2866
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 388 }
[ 2830, 3393, 16547, 2142, 1155, 353, 8840, 836, 8, 341, 84441, 11, 6461, 1669, 501, 2051, 1006, 197, 20479, 27121, 32131, 61528, 17637, 510, 220, 829, 25, 847, 2630, 69, 12, 15, 198, 9535, 510, 220, 4343, 2768, 25, 1887, 198, 220, 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...
1
func TestCreateBlockImageFailure(t *testing.T) { clientFunc := func(client RookRestClient) (interface{}, error) { return client.CreateBlockImage(model.BlockImage{Name: "image1"}) } verifyFunc := getStringVerifyFunc(t) ClientFailureHelperWithVerification(t, clientFunc, verifyFunc) }
explode_data.jsonl/27855
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 97 }
[ 2830, 3393, 4021, 4713, 1906, 17507, 1155, 353, 8840, 836, 8, 341, 25291, 9626, 1669, 2915, 12805, 431, 1941, 12416, 2959, 8, 320, 4970, 22655, 1465, 8, 341, 197, 853, 2943, 7251, 4713, 1906, 7635, 28477, 1906, 63121, 25, 330, 1805, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAPIListUsers(t *testing.T) { defer prepareTestEnv(t)() adminUsername := "user1" session := loginUser(t, adminUsername) token := getTokenForLoggedInUser(t, session) urlStr := fmt.Sprintf("/api/v1/admin/users?token=%s", token) req := NewRequest(t, "GET", urlStr) resp := session.MakeRequest(t, req, http.StatusOK) var users []api.User DecodeJSON(t, resp, &users) found := false for _, user := range users { if user.UserName == adminUsername { found = true } } assert.True(t, found) numberOfUsers := models.GetCount(t, &models.User{}, "type = 0") assert.Equal(t, numberOfUsers, len(users)) }
explode_data.jsonl/71782
{ "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, 7082, 852, 7137, 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, 1155, 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...
3
func TestCopyFile_NonExistentDestDir(t *testing.T) { // nolint:gosec src, err := ioutil.TempFile("", "") require.NoError(t, err) t.Cleanup(func() { err := os.RemoveAll(src.Name()) assert.NoError(t, err) }) err = CopyFile(src.Name(), "non-existent/dest") require.EqualError(t, err, "destination directory doesn't exist: \"non-existent\"") }
explode_data.jsonl/17816
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 140 }
[ 2830, 3393, 12106, 1703, 1604, 263, 840, 18128, 34830, 6184, 1155, 353, 8840, 836, 8, 341, 197, 322, 308, 337, 396, 70418, 960, 66, 198, 41144, 11, 1848, 1669, 43144, 65009, 1703, 19814, 14676, 17957, 35699, 1155, 11, 1848, 340, 3244, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMainResetCLIGlobals(t *testing.T) { assert := assert.New(t) assert.NotEqual(cli.AppHelpTemplate, "") assert.NotNil(savedCLIVersionPrinter) assert.NotNil(savedCLIErrWriter) cli.AppHelpTemplate = "" cli.VersionPrinter = nil cli.ErrWriter = nil resetCLIGlobals() assert.Equal(cli.AppHelpTemplate, savedCLIAppHelpTemplate) assert.NotNil(cli.VersionPrinter) assert.NotNil(savedCLIVersionPrinter) }
explode_data.jsonl/52208
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 164 }
[ 2830, 3393, 6202, 14828, 3140, 1914, 16616, 1155, 353, 8840, 836, 8, 341, 6948, 1669, 2060, 7121, 1155, 692, 6948, 15000, 2993, 70249, 5105, 12689, 7275, 11, 14676, 6948, 93882, 14217, 3140, 3090, 1325, 45660, 340, 6948, 93882, 14217, 314...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTagLinkOnlySupport(t *testing.T) { html := ` <li>Особое канадское искусство. </li> <li>Результаты нашего странного эксперимента.</li> <li>Теперь можно и в <a href="https://t.me/uwp_podcast">телеграмме</a></li> <li>Саботаж на местах.</li> <li>Их нравы: кумовство и коррупция.</li> <li>Вопросы и ответы</li> </ul> <p><a href="https://podcast.umputun.com/media/ump_podcast437.mp3"><em>аудио</em></a></p>` htmlExpected := ` Особое канадское искусство. Результаты нашего странного эксперимента. Теперь можно и в <a href="https://t.me/uwp_podcast">телеграмме</a> Саботаж на местах. Их нравы: кумовство и коррупция. Вопросы и ответы <a href="https://podcast.umputun.com/media/ump_podcast437.mp3">аудио</a>` client := TelegramClient{} got := client.tagLinkOnlySupport(html) assert.Equal(t, htmlExpected, got, "support only html tag a") }
explode_data.jsonl/50724
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 591 }
[ 2830, 3393, 5668, 3939, 7308, 7916, 1155, 353, 8840, 836, 8, 341, 36126, 1669, 22074, 8812, 29, 20353, 126782, 43767, 138205, 22833, 132188, 136456, 126293, 13, 690, 742, 397, 8812, 29, 33504, 76284, 4552, 140072, 126540, 38800, 137978, 759...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestValueEntryCorruption(t *testing.T) { dir, err := ioutil.TempDir("", "badger-test") require.NoError(t, err) defer removeDir(dir) opt := getTestOptions(dir) opt.VerifyValueChecksum = true db, err := Open(opt) require.NoError(t, err) k := []byte("KEY") v := []byte(fmt.Sprintf("val%100d", 10)) require.Greater(t, len(v), db.opt.ValueThreshold) txnSet(t, db, k, v, 0) path := db.vlog.fpath(0) require.NoError(t, db.Close()) file, err := os.OpenFile(path, os.O_RDWR, 0644) require.NoError(t, err) offset := 50 orig := make([]byte, 1) _, err = file.ReadAt(orig, int64(offset)) require.NoError(t, err) // Corrupt a single bit. _, err = file.WriteAt([]byte{7}, int64(offset)) require.NoError(t, err) require.NoError(t, file.Close()) db, err = Open(opt) require.NoError(t, err) txn := db.NewTransaction(false) entry, err := txn.Get(k) require.NoError(t, err) x, err := entry.ValueCopy(nil) require.Error(t, err) require.Contains(t, err.Error(), "checksum mismatch") require.Nil(t, x) require.NoError(t, db.Close()) }
explode_data.jsonl/39107
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 447 }
[ 2830, 3393, 1130, 5874, 10580, 14123, 1155, 353, 8840, 836, 8, 341, 48532, 11, 1848, 1669, 43144, 65009, 6184, 19814, 330, 13855, 1389, 16839, 1138, 17957, 35699, 1155, 11, 1848, 340, 16867, 4057, 6184, 14161, 692, 64838, 1669, 633, 2271,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRequest_IsNewSession(t *testing.T) { tests := []struct { name string request *alice.Request want bool }{ { name: "", request: getReq(0), want: true, }, { name: "", request: getReq(1), want: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := tt.request if got := req.IsNewSession(); got != tt.want { t.Errorf("Request.IsNewSession() = %v, want %v", got, tt.want) } }) } }
explode_data.jsonl/18230
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 240 }
[ 2830, 3393, 1900, 31879, 3564, 5283, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 262, 914, 198, 197, 23555, 353, 63195, 9659, 198, 197, 50780, 262, 1807, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 262,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestWebsocketInit(t *testing.T) { if wsTest.Websocket != nil { t.Error("test failed - WebsocketInit() error") } wsTest.WebsocketInit() if wsTest.Websocket == nil { t.Error("test failed - WebsocketInit() error") } }
explode_data.jsonl/29303
{ "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, 5981, 9556, 3803, 1155, 353, 8840, 836, 8, 341, 743, 17624, 2271, 6473, 9556, 961, 2092, 341, 197, 3244, 6141, 445, 1944, 4641, 481, 4895, 9556, 3803, 368, 1465, 1138, 197, 630, 6692, 82, 2271, 6473, 9556, 3803, 2822, 743,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRecoverEIP712(t *testing.T) { data, err := hex.DecodeString("634fb5a872396d9693e5c9f9d7233cfa93f395c093371017ff44aa9ae6564cdd") if err != nil { t.Fatal(err) } privKey, err := crypto.DecodeSecp256k1PrivateKey(data) if err != nil { t.Fatal(err) } expected, err := hex.DecodeString("60f054c45d37a0359d4935da0454bc19f02a8c01ceee8a112cfe48c8e2357b842e897f76389fb96947c6d2c80cbfe081052204e7b0c3cc1194a973a09b1614f71c") if err != nil { t.Fatal(err) } pubKey, err := crypto.RecoverEIP712(expected, testTypedData) if err != nil { t.Fatal(err) } if privKey.PublicKey.X.Cmp(pubKey.X) != 0 { t.Fatalf("recovered wrong public key. wanted %x, got %x", privKey.PublicKey, pubKey) } if privKey.PublicKey.Y.Cmp(pubKey.Y) != 0 { t.Fatalf("recovered wrong public key. wanted %x, got %x", privKey.PublicKey, pubKey) } }
explode_data.jsonl/31477
{ "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, 693, 3688, 36, 3298, 22, 16, 17, 1155, 353, 8840, 836, 8, 341, 8924, 11, 1848, 1669, 12371, 56372, 703, 445, 21, 18, 19, 10798, 20, 64, 23, 22, 17, 18, 24, 21, 67, 24, 21, 24, 18, 68, 20, 66, 24, 69, 24, 67, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
func TestMigrationTransaction(t *testing.T) { // generate env := setup(t) slot := uint64(2) subsidizerKey := testutil.GenerateSolanaKeypair(t) subsidizer := subsidizerKey.Public().(ed25519.PublicKey) migrationAddress := testutil.GenerateSolanaKeys(t, 1)[0] tokenMint := testutil.GenerateSolanaKeys(t, 1)[0] owner := testutil.GenerateSolanaKeys(t, 1)[0] // Lookup for payment (dest) as well as ownership transfer env.sc.On("GetAccountInfo", migrationAddress, solana.CommitmentSingle).Return(generateAccountInfo(0, env.mint, owner, token.ProgramKey), nil).Twice() txn := solana.NewTransaction( subsidizer, system.CreateAccount( subsidizer, migrationAddress, migrationAddress, 10, 10, ), token.InitializeAccount( migrationAddress, env.mint, migrationAddress, ), token.SetAuthority( migrationAddress, migrationAddress, subsidizer, token.AuthorityTypeCloseAccount, ), token.SetAuthority( migrationAddress, migrationAddress, owner, token.AuthorityTypeAccountHolder, ), token.Transfer( tokenMint, migrationAddress, tokenMint, 10, ), ) assert.NoError(t, txn.Sign(subsidizerKey)) entry := &model.Entry{ Version: model.KinVersion_KIN4, Kind: &model.Entry_Solana{ Solana: &model.SolanaEntry{ Slot: slot, Confirmed: true, BlockTime: timestamppb.Now(), Transaction: txn.Marshal(), }, }, } require.NoError(t, env.rw.Write(context.Background(), entry)) sc, err := env.processor.ProcessRange(context.Background(), model.OrderingKeyFromBlock(0), model.OrderingKeyFromBlock(10), 0) assert.NoError(t, err) orderingKey, err := entry.GetOrderingKey() require.NoError(t, err) assert.Equal(t, orderingKey, sc.LastKey) assert.Equal(t, 1, len(sc.Creations)) assert.Equal(t, migrationAddress, sc.Creations[0].Account) assert.Equal(t, owner, sc.Creations[0].AccountOwner) assert.Equal(t, subsidizer, sc.Creations[0].Subsidizer) assert.Equal(t, 1, len(sc.Payments)) assertPayment(t, sc.Payments[0], 4, 10, tokenMint, tokenMint, migrationAddress, owner) env.sc.AssertExpectations(t) }
explode_data.jsonl/42354
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 843 }
[ 2830, 3393, 20168, 8070, 1155, 353, 8840, 836, 8, 341, 197, 322, 6923, 198, 57538, 1669, 6505, 1155, 340, 61675, 1669, 2622, 21, 19, 7, 17, 692, 1903, 15738, 307, 3135, 1592, 1669, 1273, 1314, 57582, 48812, 3362, 6608, 1082, 1310, 115...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCreateUser_DB(t *testing.T) { userlist, _ = FindAllUser() cases := []struct { in User want []User }{ {t_users[0], t_users[:1]}, {t_users[1], t_users[:2]}, {t_users[2], t_users[:3]}, } for _, c := range cases { CreateUser_DB(&c.in) userlist, _ = FindAllUser() fmt.Printf("CreateUser_DB userlist: %v\n", userlist) if got := userlist; !reflect.DeepEqual(got, c.want) { t.Errorf("CreateUser_DB(%q) == %q, want %q", c.in, got, c.want) } } }
explode_data.jsonl/66504
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 299 }
[ 2830, 3393, 4021, 1474, 16310, 1155, 353, 8840, 836, 8, 341, 262, 1196, 1607, 11, 716, 284, 7379, 2403, 1474, 741, 262, 5048, 1669, 3056, 1235, 341, 286, 304, 2657, 198, 286, 1366, 3056, 1474, 198, 262, 335, 515, 286, 314, 83, 16348...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestExpose(t *testing.T) { b := &Builder{flags: &BFlags{}, runConfig: &container.Config{}, disableCommit: true} exposedPort := "80" if err := expose(b, []string{exposedPort}, nil, ""); err != nil { t.Fatalf("Error should be empty, got: %s", err.Error()) } if b.runConfig.ExposedPorts == nil { t.Fatalf("ExposedPorts should be set") } if len(b.runConfig.ExposedPorts) != 1 { t.Fatalf("ExposedPorts should contain only 1 element. Got %s", b.runConfig.ExposedPorts) } portsMapping, err := nat.ParsePortSpec(exposedPort) if err != nil { t.Fatalf("Error when parsing port spec: %s", err.Error()) } if _, ok := b.runConfig.ExposedPorts[portsMapping[0].Port]; !ok { t.Fatalf("Port %s should be present. Got %s", exposedPort, b.runConfig.ExposedPorts) } }
explode_data.jsonl/28284
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 301 }
[ 2830, 3393, 40073, 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, 8122, 3865, 7084, 1669, 330, 23, 15, 1837, 743, 1848, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEnableFilesetsFromOverrides(t *testing.T) { tests := []struct { Name string Cfg []*ModuleConfig Overrides *ModuleOverrides Expected []*ModuleConfig }{ { Name: "add fileset", Cfg: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, }, }, }, Overrides: &ModuleOverrides{ "foo": { "baz": nil, }, }, Expected: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, "baz": {}, }, }, }, }, { Name: "defined fileset", Cfg: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": { Var: map[string]interface{}{ "a": "b", }, }, }, }, }, Overrides: &ModuleOverrides{ "foo": { "bar": nil, }, }, Expected: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": { Var: map[string]interface{}{ "a": "b", }, }, }, }, }, }, { Name: "disabled module", Cfg: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, }, }, }, Overrides: &ModuleOverrides{ "other": { "bar": nil, }, }, Expected: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, }, }, }, }, { Name: "nil overrides", Cfg: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, }, }, }, Overrides: nil, Expected: []*ModuleConfig{ { Module: "foo", Filesets: map[string]*FilesetConfig{ "bar": {}, }, }, }, }, { Name: "no modules", Cfg: nil, Overrides: &ModuleOverrides{ "other": { "bar": nil, }, }, Expected: nil, }, } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { enableFilesetsFromOverrides(test.Cfg, test.Overrides) assert.Equal(t, test.Expected, test.Cfg) }) } }
explode_data.jsonl/64761
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1187 }
[ 2830, 3393, 11084, 1703, 4917, 3830, 80010, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 21297, 414, 914, 198, 197, 6258, 4817, 981, 29838, 3332, 2648, 198, 197, 197, 80010, 353, 3332, 80010, 198, 197, 197, 18896, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAddForceOverwrite(t *testing.T) { kv := secretmanager.NewInMemoryClient("cl-test", "withlabels", "bar", "withoutlabels", "zulu") // Update secret with labels secret, _ := kv.Get("withlabels") secret.SetLabels(map[string]string{"a": "b"}) cmdOpts := addCommand{Positional: addCommandPositional{"cl-test", "withlabels"}, Data: "baz1", Labels: map[string]string{"a": "b"}, client: kv, Force: []bool{true}} err := cmdOpts.Execute([]string{}) assert.NoError(t, err) secretData, _ := secret.GetValue() assert.Equal(t, "baz1", string(secretData)) // Update secret with changed labels secret, _ = kv.Get("withlabels") secret.SetLabels(map[string]string{"a": "b"}) cmdOpts = addCommand{Positional: addCommandPositional{"cl-test", "withlabels"}, Data: "baz1", Labels: map[string]string{"a": "different"}, client: kv, Force: []bool{true}} err = cmdOpts.Execute([]string{}) assert.NoError(t, err) secretData, _ = secret.GetValue() assert.Equal(t, "baz1", string(secretData)) assert.Equal(t, map[string]string{"a": "different"}, secret.GetLabels()) // Update secret without labels secret, _ = kv.Get("withoutlabels") cmdOpts = addCommand{Positional: addCommandPositional{"cl-test", "withoutlabels"}, Data: "baz2", client: kv, Force: []bool{true}} err = cmdOpts.Execute([]string{}) assert.NoError(t, err) secretData, _ = secret.GetValue() assert.Equal(t, "baz2", string(secretData)) }
explode_data.jsonl/60318
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 517 }
[ 2830, 3393, 2212, 18573, 1918, 4934, 1155, 353, 8840, 836, 8, 341, 16463, 85, 1669, 6234, 13297, 7121, 641, 10642, 2959, 445, 564, 16839, 497, 330, 4197, 16873, 497, 330, 2257, 497, 330, 28996, 16873, 497, 330, 89, 24411, 5130, 197, 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 TestPutFileToDirectoryReturnsError(t *testing.T) { beforeTest(t) conn := _getConnection(t) defer conn.Close() client := agaveproto.NewSftpRelayClient(conn) // create a temp file to put tmpTestFilePath, err := _createTempFile("", ".bin") if err != nil { assert.FailNowf(t, err.Error(), "Unable to create temp test file: %s", err.Error()) } resolvedLocalTestFilePath := _resolveTestPath(tmpTestFilePath, LocalSharedTestDir) // create a directory as the target of our put tmpTestDirPath, err := _createTempDirectory("") if err != nil { assert.FailNowf(t, err.Error(), "Unable to create temp test file: %s", err.Error()) } resolvedRemoteTestDirPath := _resolveTestPath(tmpTestDirPath, SFTP_SHARED_TEST_DIR) req := &agaveproto.SrvPutRequest{ SystemConfig: _createRemoteSystemConfig(), LocalPath: resolvedLocalTestFilePath, RemotePath: resolvedRemoteTestDirPath, Force: true, Append: false, } grpcResponse, err := client.Put(context.Background(), req) if err != nil { assert.Nilf(t, err, "Error while invoking remote service: %v", err) } else { // get the test directory stat in the local shared directory resolvedLocalTestDirPath := _resolveTestPath(tmpTestDirPath, LocalSharedTestDir) targetTestDirInfo, err := os.Stat(resolvedLocalTestDirPath) if err != nil { assert.FailNowf(t, err.Error(), "Unable to open temp directory, %s, on remote host after put: %s", resolvedLocalTestDirPath, err.Error()) } assert.True(t, targetTestDirInfo.IsDir(), "Putting a file to a directory should fail and preserve the target directory") assert.Contains(t, strings.ToLower(grpcResponse.Error), "destination path is a directory", "Error message in response should indicate the destination path is a directory") assert.Nil(t, grpcResponse.RemoteFileInfo, "Returned file info should be nil on error") } afterTest(t) }
explode_data.jsonl/32554
{ "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, 19103, 1703, 1249, 9310, 16446, 1454, 1155, 353, 8840, 836, 8, 341, 63234, 2271, 1155, 692, 32917, 1669, 716, 52414, 1155, 340, 16867, 4534, 10421, 2822, 25291, 1669, 933, 523, 15110, 7121, 50, 25068, 6740, 352, 2959, 20571, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPrintCertificateSigningRequest(t *testing.T) { tests := []struct { csr certificates.CertificateSigningRequest expected []metav1.TableRow }{ // Basic CSR with no spec or status; defaults to status: Pending. { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr1", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{}, Status: certificates.CertificateSigningRequestStatus{}, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr1", "0s", "<none>", "", "<none>", "Pending"}}}, }, // Basic CSR with Spec and Status=Approved. { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{ Username: "CSR Requestor", }, Status: certificates.CertificateSigningRequestStatus{ Conditions: []certificates.CertificateSigningRequestCondition{ { Type: certificates.CertificateApproved, }, }, }, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr2", "0s", "<none>", "CSR Requestor", "<none>", "Approved"}}}, }, // Basic CSR with Spec and SignerName set { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{ Username: "CSR Requestor", SignerName: "example.com/test-signer", }, Status: certificates.CertificateSigningRequestStatus{ Conditions: []certificates.CertificateSigningRequestCondition{ { Type: certificates.CertificateApproved, }, }, }, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr2", "0s", "example.com/test-signer", "CSR Requestor", "<none>", "Approved"}}}, }, // Basic CSR with Spec, SignerName and ExpirationSeconds set { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{ Username: "CSR Requestor", SignerName: "example.com/test-signer", ExpirationSeconds: csr.DurationToExpirationSeconds(7*24*time.Hour + time.Hour), // a little bit more than a week }, Status: certificates.CertificateSigningRequestStatus{ Conditions: []certificates.CertificateSigningRequestCondition{ { Type: certificates.CertificateApproved, }, }, }, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr2", "0s", "example.com/test-signer", "CSR Requestor", "7d1h", "Approved"}}}, }, // Basic CSR with Spec and Status=Approved; certificate issued. { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{ Username: "CSR Requestor", }, Status: certificates.CertificateSigningRequestStatus{ Conditions: []certificates.CertificateSigningRequestCondition{ { Type: certificates.CertificateApproved, }, }, Certificate: []byte("cert data"), }, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr2", "0s", "<none>", "CSR Requestor", "<none>", "Approved,Issued"}}}, }, // Basic CSR with Spec and Status=Denied. { csr: certificates.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{ Name: "csr3", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Spec: certificates.CertificateSigningRequestSpec{ Username: "CSR Requestor", }, Status: certificates.CertificateSigningRequestStatus{ Conditions: []certificates.CertificateSigningRequestCondition{ { Type: certificates.CertificateDenied, }, }, }, }, // Columns: Name, Age, SignerName, Requestor, RequestedDuration, Condition expected: []metav1.TableRow{{Cells: []interface{}{"csr3", "0s", "<none>", "CSR Requestor", "<none>", "Denied"}}}, }, } for i, test := range tests { rows, err := printCertificateSigningRequest(&test.csr, printers.GenerateOptions{}) if err != nil { t.Fatal(err) } for i := range rows { rows[i].Object.Object = nil } if !reflect.DeepEqual(test.expected, rows) { t.Errorf("%d mismatch: %s", i, diff.ObjectReflectDiff(test.expected, rows)) } } }
explode_data.jsonl/72293
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 2160 }
[ 2830, 3393, 8994, 33202, 93358, 1900, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 1444, 15094, 414, 34437, 727, 20962, 93358, 1900, 198, 197, 42400, 3056, 4059, 402, 16, 18257, 3102, 198, 197, 59403, 197, 197, 322, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAstarte(t *testing.T) { astarteList := &operator.AstarteList{} err := framework.AddToFrameworkScheme(apis.AddToScheme, astarteList) if err != nil { t.Fatalf("failed to add custom resource scheme to framework: %v", err) } // run subtests t.Run("astarte-group", func(t *testing.T) { t.Run("Cluster", AstarteCluster) }) }
explode_data.jsonl/6625
{ "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, 32, 2468, 68, 1155, 353, 8840, 836, 8, 341, 88836, 19840, 852, 1669, 609, 7884, 875, 2468, 68, 852, 16094, 9859, 1669, 12626, 1904, 1249, 14837, 28906, 7, 13725, 1904, 1249, 28906, 11, 264, 2468, 68, 852, 340, 743, 1848, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSetContainer(t *testing.T) { cfg, output, err := settings.FromFlags("lambda-router", []string{"-local=false"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } assert.Empty(t, output) expected := settings.DefaultConfig() expected.IsLocal = false assert.Equal(t, cfg, expected) }
explode_data.jsonl/14450
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 109 }
[ 2830, 3393, 1649, 4502, 1155, 353, 8840, 836, 8, 341, 50286, 11, 2550, 11, 1848, 1669, 5003, 11439, 9195, 445, 12935, 14266, 497, 3056, 917, 4913, 12, 2438, 12219, 23625, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 29430, 1465, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClient_Aggregators(t *testing.T) { ctx := context.Background() asUser := userClient(t) withToken := withToken(t, asUser) created, err := withToken.CreateAggregator(ctx, types.CreateAggregator{ Name: "test-aggregator", Version: types.DefaultAggregatorVersion, AddHealthCheckPipeline: true, }) wantEqual(t, err, nil) project := defaultProject(t, asUser) got, err := asUser.Aggregators(ctx, project.ID, types.AggregatorsParams{}) wantEqual(t, err, nil) wantEqual(t, len(got.Items), 1) wantEqual(t, got.Items[0].ID, created.ID) wantEqual(t, got.Items[0].Name, created.Name) wantEqual(t, got.Items[0].Version, created.Version) wantEqual(t, got.Items[0].Token, created.Token) wantEqual(t, got.Items[0].PipelinesCount, uint64(1)) wantEqual(t, got.Items[0].CreatedAt, created.CreatedAt) wantEqual(t, got.Items[0].UpdatedAt, created.CreatedAt) t.Run("pagination", func(t *testing.T) { for i := 0; i < 10; i++ { _, err := withToken.CreateAggregator(ctx, types.CreateAggregator{ Name: fmt.Sprintf("test-aggregator-%d", i), Version: types.DefaultAggregatorVersion, }) wantEqual(t, err, nil) } page1, err := asUser.Aggregators(ctx, project.ID, types.AggregatorsParams{ Last: ptrUint64(3), }) wantEqual(t, err, nil) wantEqual(t, len(page1.Items), 3) wantNoEqual(t, page1.EndCursor, (*string)(nil)) page2, err := asUser.Aggregators(ctx, project.ID, types.AggregatorsParams{ Last: ptrUint64(3), Before: page1.EndCursor, }) wantEqual(t, err, nil) wantEqual(t, len(page2.Items), 3) wantNoEqual(t, page2.EndCursor, (*string)(nil)) wantNoEqual(t, page1.Items, page2.Items) wantNoEqual(t, *page1.EndCursor, *page2.EndCursor) wantEqual(t, page1.Items[2].CreatedAt.After(page2.Items[0].CreatedAt), true) }) t.Run("tags", func(t *testing.T) { for i := 10; i < 20; i++ { aggregator := types.CreateAggregator{ Name: fmt.Sprintf("test-aggregator-%d", i), Version: types.DefaultAggregatorVersion, } if i >= 15 { aggregator.Tags = append(aggregator.Tags, "tagone", "tagthree") } else { aggregator.Tags = append(aggregator.Tags, "tagtwo", "tagthree") } _, err := withToken.CreateAggregator(ctx, aggregator) wantEqual(t, err, nil) } opts := types.AggregatorsParams{} s := TagOne opts.Tags = &s tag1, err := asUser.Aggregators(ctx, project.ID, opts) wantEqual(t, err, nil) wantEqual(t, len(tag1.Items), 5) wantEqual(t, tag1.Items[0].Tags, []string{TagOne, TagThree}) s2 := TagTwo opts.Tags = &s2 tag2, err := asUser.Aggregators(ctx, project.ID, opts) wantEqual(t, err, nil) wantEqual(t, len(tag2.Items), 5) wantEqual(t, tag2.Items[0].Tags, []string{"tagtwo", "tagthree"}) s3 := TagThree opts.Tags = &s3 tag3, err := asUser.Aggregators(ctx, project.ID, opts) wantEqual(t, err, nil) wantEqual(t, len(tag3.Items), 10) wantEqual(t, tag3.Items[0].Tags, []string{"tagone", "tagthree"}) s4 := fmt.Sprintf("%s AND %s", TagOne, TagTwo) opts.Tags = &s4 tag4, err := asUser.Aggregators(ctx, project.ID, opts) wantEqual(t, err, nil) wantEqual(t, len(tag4.Items), 0) }) }
explode_data.jsonl/30417
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1409 }
[ 2830, 3393, 2959, 1566, 70, 7998, 2973, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 60451, 1474, 1669, 1196, 2959, 1155, 340, 46948, 3323, 1669, 448, 3323, 1155, 11, 438, 1474, 692, 197, 7120, 11, 1848, 1669, 448, 332...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClient_logger(t *testing.T) { t.Run("net/rpc", func(t *testing.T) { testClient_logger(t, "netrpc") }) t.Run("grpc", func(t *testing.T) { testClient_logger(t, "grpc") }) }
explode_data.jsonl/57862
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 81 }
[ 2830, 3393, 2959, 27413, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 4711, 7382, 3992, 497, 2915, 1155, 353, 8840, 836, 8, 314, 1273, 2959, 27413, 1155, 11, 330, 4711, 29414, 899, 2751, 3244, 16708, 445, 56585, 497, 2915, 1155, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLiveUpdateMultipleContainersFallsBackForFailureAfterSuccess(t *testing.T) { f := newBDFixture(t, k8s.EnvDockerDesktop, container.RuntimeDocker) defer f.TearDown() // First call = no error, second call = error f.docker.ExecErrorsToThrow = []error{nil, fmt.Errorf("egads")} m := NewSanchoLiveUpdateManifest(f) cIDs := []container.ID{"c1", "c2", "c3"} tCase := testCase{ manifest: m, runningContainersByTarget: map[model.TargetID][]container.ID{m.ImageTargetAt(0).ID(): cIDs}, changedFiles: []string{"a.txt"}, // one successful update (copy, exec, restart); // one truncated update (copy, exec) before hitting error expectDockerCopyCount: 2, expectDockerExecCount: 2, expectDockerRestartCount: 1, // fell back to image build expectDockerBuildCount: 1, expectK8sDeploy: true, } runTestCase(t, f, tCase) }
explode_data.jsonl/35163
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 358 }
[ 2830, 3393, 20324, 4289, 32089, 74632, 37, 5583, 3707, 2461, 17507, 6025, 7188, 1155, 353, 8840, 836, 8, 341, 1166, 1669, 501, 33, 5262, 12735, 1155, 11, 595, 23, 82, 81214, 35, 13659, 23597, 11, 5476, 16706, 35, 13659, 340, 16867, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_Arguments_Diff_WithArgMatcher(t *testing.T) { matchFn := func(a int) bool { return a == 123 } var args = Arguments([]interface{}{"string", MatchedBy(matchFn), true}) diff, count := args.Diff([]interface{}{"string", 124, true}) assert.Equal(t, 1, count) assert.Contains(t, diff, `%!s(int=124) not matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", false, true}) assert.Equal(t, 1, count) assert.Contains(t, diff, `%!s(bool=false) not matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", 123, false}) assert.Contains(t, diff, `%!s(int=123) matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", 123, true}) assert.Equal(t, 0, count) assert.Contains(t, diff, `No differences.`) }
explode_data.jsonl/8620
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 323 }
[ 2830, 3393, 87581, 2831, 1557, 3092, 62, 2354, 2735, 37554, 1155, 353, 8840, 836, 8, 972, 47706, 24911, 1669, 2915, 2877, 526, 8, 1807, 972, 197, 853, 264, 621, 220, 16, 17, 18, 319, 197, 1771, 2405, 2827, 284, 27702, 10556, 4970, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCLI(t *testing.T) { const ( kubeContext = "some-kubecontext" output = "this is the expected output" ) tests := []struct { name string kubeconfig string namespace string expectedCommand string }{ { name: "without namespace or kubeconfig", expectedCommand: "kubectl --context some-kubecontext exec arg1 arg2", }, { name: "only namespace, no kubeconfig", namespace: "some-namespace", expectedCommand: "kubectl --context some-kubecontext --namespace some-namespace exec arg1 arg2", }, { name: "only kubeconfig, no namespace", kubeconfig: "some-kubeconfig", expectedCommand: "kubectl --context some-kubecontext --kubeconfig some-kubeconfig exec arg1 arg2", }, { name: "with namespace and kubeconfig", kubeconfig: "some-kubeconfig", namespace: "some-namespace", expectedCommand: "kubectl --context some-kubecontext --namespace some-namespace --kubeconfig some-kubeconfig exec arg1 arg2", }, } // test cli.Run() for _, test := range tests { testutil.Run(t, test.name, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, testutil.CmdRun( test.expectedCommand, )) cli := NewFromRunContext(&runcontext.RunContext{ Opts: config.SkaffoldOptions{ Namespace: test.namespace, KubeConfig: test.kubeconfig, }, KubeContext: kubeContext, }) err := cli.Run(context.Background(), nil, nil, "exec", "arg1", "arg2") t.CheckNoError(err) }) } // test cli.RunOut() for _, test := range tests { testutil.Run(t, test.name, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, testutil.CmdRunOut( test.expectedCommand, output, )) cli := NewFromRunContext(&runcontext.RunContext{ Opts: config.SkaffoldOptions{ Namespace: test.namespace, KubeConfig: test.kubeconfig, }, KubeContext: kubeContext, }) out, err := cli.RunOut(context.Background(), "exec", "arg1", "arg2") t.CheckNoError(err) t.CheckDeepEqual(string(out), output) }) } }
explode_data.jsonl/7994
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 948 }
[ 2830, 3393, 63959, 1155, 353, 8840, 836, 8, 341, 4777, 2399, 197, 16463, 3760, 1972, 284, 330, 14689, 12646, 3760, 2147, 698, 197, 21170, 414, 284, 330, 574, 374, 279, 3601, 2550, 698, 197, 692, 78216, 1669, 3056, 1235, 341, 197, 1160...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEngine_WriteAddNewField(t *testing.T) { engine := NewDefaultEngine() defer engine.Close() engine.MustOpen() name := tsdb.EncodeNameString(engine.org, engine.bucket) if err := engine.Engine.WritePoints(context.TODO(), []models.Point{models.MustNewPoint( name, models.NewTags(map[string]string{models.FieldKeyTagKey: "value", models.MeasurementTagKey: "cpu", "host": "server"}), map[string]interface{}{"value": 1.0}, time.Unix(1, 2), )}); err != nil { t.Fatalf(err.Error()) } if err := engine.Engine.WritePoints(context.TODO(), []models.Point{ models.MustNewPoint( name, models.NewTags(map[string]string{models.FieldKeyTagKey: "value", models.MeasurementTagKey: "cpu", "host": "server"}), map[string]interface{}{"value": 1.0}, time.Unix(1, 2), ), models.MustNewPoint( name, models.NewTags(map[string]string{models.FieldKeyTagKey: "value2", models.MeasurementTagKey: "cpu", "host": "server"}), map[string]interface{}{"value2": 2.0}, time.Unix(1, 2), ), }); err != nil { t.Fatalf(err.Error()) } if got, exp := engine.SeriesCardinality(), int64(2); got != exp { t.Fatalf("got %d series, exp %d series in index", got, exp) } }
explode_data.jsonl/5985
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 467 }
[ 2830, 3393, 4571, 31825, 2212, 3564, 1877, 1155, 353, 8840, 836, 8, 341, 80118, 1669, 1532, 3675, 4571, 741, 16867, 4712, 10421, 741, 80118, 50463, 5002, 2822, 11609, 1669, 10591, 1999, 50217, 675, 703, 48974, 2659, 11, 4712, 71626, 692, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNestedTypes(test *testing.T) { var err error _, err = parseRDLString(` type Foo Struct { Struct { String name } bar; } `) if err != nil { test.Errorf("cannot parse valid RDL with resource name: %v", err) } _, err = parseRDLString(` type Foo Struct { Struct { Struct { String name } foo; } bar; } `) }
explode_data.jsonl/74354
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 168 }
[ 2830, 3393, 71986, 4173, 8623, 353, 8840, 836, 8, 341, 2405, 1848, 1465, 198, 197, 6878, 1848, 284, 4715, 49, 16524, 703, 61528, 1313, 33428, 16139, 341, 262, 16139, 341, 286, 923, 829, 198, 262, 335, 3619, 280, 532, 24183, 743, 1848,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_search(t *testing.T) { s := newSearches() for i := int16(0); i <= math.MaxInt16; i++ { if id, _ := s.Insert(nil, nil); id != i { t.Error(id, i) break } if i == math.MaxInt16 { break } } }
explode_data.jsonl/9558
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 109 }
[ 2830, 3393, 10716, 1155, 353, 8840, 836, 8, 341, 1903, 1669, 501, 5890, 288, 741, 2023, 600, 1669, 526, 16, 21, 7, 15, 1215, 600, 2651, 6888, 14535, 1072, 16, 21, 26, 600, 1027, 341, 197, 743, 877, 11, 716, 1669, 274, 23142, 27907...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMigrateUnsupported(t *testing.T) { tmpdir, err := ioutil.TempDir("", "migrate-empty") if err != nil { t.Fatal(err) } defer os.RemoveAll(tmpdir) err = os.MkdirAll(filepath.Join(tmpdir, "graph"), 0700) if err != nil { t.Fatal(err) } err = Migrate(tmpdir, "generic", nil, nil, nil, nil) if err != errUnsupported { t.Fatalf("expected unsupported error, got %q", err) } }
explode_data.jsonl/52001
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 165 }
[ 2830, 3393, 44, 34479, 41884, 1155, 353, 8840, 836, 8, 341, 20082, 3741, 11, 1848, 1669, 43144, 65009, 6184, 19814, 330, 76, 34479, 39433, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 16867, 2643, 84427, 10368...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMarkdownMessage_SetMarkdown(t *testing.T) { got := NewMarkdownMessage() got.SetMarkdown("title", "text") want := NewMarkdownMessage() want.Markdown = Markdown{ Title: "title", Text: "text", } if !reflect.DeepEqual(got, want) { t.Errorf("SetMarkdown() = %v, want %v", got, want) } }
explode_data.jsonl/74060
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 122 }
[ 2830, 3393, 68005, 2052, 14812, 68005, 1155, 353, 8840, 836, 8, 341, 3174, 354, 1669, 1532, 68005, 2052, 741, 3174, 354, 4202, 68005, 445, 2102, 497, 330, 1318, 5130, 50780, 1669, 1532, 68005, 2052, 741, 50780, 75888, 2923, 284, 73192, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFindConfigFile(t *testing.T) { cases := []struct { input []string statResults []error exp string }{ {input: []string{"myfile"}, statResults: []error{nil}, exp: "myfile"}, {input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, nil}, exp: "thatfile"}, {input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, os.ErrNotExist}, exp: ""}, } statFunc = fakestat for id, c := range cases { t.Run(strconv.Itoa(id), func(t *testing.T) { e = c.statResults eIndex = 0 conf := findConfigFile(c.input) if conf != c.exp { t.Fatalf("Got %s expected %s", conf, c.exp) } }) } }
explode_data.jsonl/60199
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 290 }
[ 2830, 3393, 9885, 2648, 1703, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 22427, 981, 3056, 917, 198, 197, 78085, 9801, 3056, 841, 198, 197, 48558, 260, 914, 198, 197, 59403, 197, 197, 90, 1355, 25, 3056, 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 TestIdenticalUnions(t *testing.T) { tname := NewTypeName(nopos, nil, "myInt", nil) myInt := NewNamed(tname, Typ[Int], nil) tmap := map[string]*Term{ "int": NewTerm(false, Typ[Int]), "~int": NewTerm(true, Typ[Int]), "string": NewTerm(false, Typ[String]), "~string": NewTerm(true, Typ[String]), "myInt": NewTerm(false, myInt), } makeUnion := func(s string) *Union { parts := strings.Split(s, "|") var terms []*Term for _, p := range parts { term := tmap[p] if term == nil { t.Fatalf("missing term %q", p) } terms = append(terms, term) } return NewUnion(terms) } for _, test := range []struct { x, y string want bool }{ // These tests are just sanity checks. The tests for type sets and // interfaces provide much more test coverage. {"int|~int", "~int", true}, {"myInt|~int", "~int", true}, {"int|string", "string|int", true}, {"int|int|string", "string|int", true}, {"myInt|string", "int|string", false}, } { x := makeUnion(test.x) y := makeUnion(test.y) if got := Identical(x, y); got != test.want { t.Errorf("Identical(%v, %v) = %t", test.x, test.y, got) } } }
explode_data.jsonl/29394
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 492 }
[ 2830, 3393, 28301, 938, 1806, 908, 1155, 353, 8840, 836, 8, 341, 3244, 606, 1669, 1532, 39429, 1445, 453, 436, 11, 2092, 11, 330, 2408, 1072, 497, 2092, 340, 13624, 1072, 1669, 1532, 15810, 1155, 606, 11, 17518, 36261, 1125, 2092, 340...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUnmarshalFloat(t *testing.T) { input := []byte(`{ "N": "123.45"}`) var av DynamoDBAttributeValue err := json.Unmarshal(input, &av) assert.Nil(t, err) var f float64 f, err = av.Float() assert.Nil(t, err) assert.Equal(t, 123.45, f) }
explode_data.jsonl/61700
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 115 }
[ 2830, 3393, 1806, 27121, 5442, 1155, 353, 8840, 836, 8, 341, 22427, 1669, 3056, 3782, 5809, 90, 330, 45, 788, 330, 16, 17, 18, 13, 19, 20, 1, 5541, 692, 2405, 1822, 71813, 3506, 78554, 198, 9859, 1669, 2951, 38097, 5384, 11, 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
func TestParsePasses(t *testing.T) { // All the tests should pass. tests := []struct { in string out *Node }{ {"w", &Node{Phrase: "w", Verb: Should}}, // { `+"machine learning"`, &Node{Verb: Must, Phrase: "machine learning"}, }, // { "x y", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, {Phrase: "y", Verb: Should}, }, }, }, // { "x,y", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, {Phrase: "y", Verb: Should}, }, }, }, // { "x,+y", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, {Phrase: "y", Verb: Must}, }, }, }, // { "x, +y", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, {Phrase: "y", Verb: Must}, }, }, }, // { "-x +y", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Not}, {Phrase: "y", Verb: Must}, }, }, }, // { "x +[+y -z]", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, // Subquery +[+y - z] { Verb: Must, Children: []*Node{ {Phrase: "y", Verb: Must}, {Phrase: "z", Verb: Not}, }, }, }, }, }, // { "x, +[+y, -z]", &Node{ Verb: Should, Children: []*Node{ {Phrase: "x", Verb: Should}, // Subquery +[+y - z] { Verb: Must, Children: []*Node{ {Phrase: "y", Verb: Must}, {Phrase: "z", Verb: Not}, }, }, }, }, }, // { `+"phrase one", [+"phrase 2", -z]`, &Node{ Verb: Should, Children: []*Node{ { Verb: Must, Phrase: "phrase one"}, // Subquery +[+y - z] { Verb: Should, Children: []*Node{ {Phrase: "phrase 2", Verb: Must}, {Phrase: "z", Verb: Not}, }, }, }, }, }, // { `+"phrase one" [+"phrase 2" -z]`, &Node{ Verb: Should, Children: []*Node{ { Verb: Must, Phrase: "phrase one"}, // Subquery +[+y - z] { Verb: Should, Children: []*Node{ {Phrase: "phrase 2", Verb: Must}, {Phrase: "z", Verb: Not}, }, }, }, }, }, } for i, tt := range tests { tree, err := Parse(tt.in) msg := fmt.Sprintf( "Fails test case (%d)\ninput: %s\ntree: %#v\ntree.String(): %s\nchildren %#v", i, tt.in, tree, tree, tree.Root().GetChildren(), ) assert.NoError(t, err, msg) assert.True(t, tt.out.Tree().Equals(tree.Tree()), msg) } }
explode_data.jsonl/31832
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1508 }
[ 2830, 3393, 14463, 12187, 288, 1155, 353, 8840, 836, 8, 341, 197, 322, 2009, 279, 7032, 1265, 1494, 624, 78216, 1669, 3056, 1235, 341, 197, 17430, 220, 914, 198, 197, 13967, 353, 1955, 198, 197, 59403, 197, 197, 4913, 86, 497, 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...
2
func TestRuleTruncateTable(t *testing.T) { common.Log.Debug("Entering function: %s", common.GetFunctionName()) sqls := []string{ `TRUNCATE TABLE tbl_name;`, } for _, sql := range sqls { q, err := NewQuery4Audit(sql) if err == nil { rule := q.RuleTruncateTable() if rule.Item != "SEC.001" { t.Error("Rule not match:", rule.Item, "Expect : SEC.001") } } else { t.Error("sqlparser.Parse Error:", err) } } common.Log.Debug("Exiting function: %s", common.GetFunctionName()) }
explode_data.jsonl/76819
{ "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, 11337, 1282, 26900, 2556, 1155, 353, 8840, 836, 8, 341, 83825, 5247, 20345, 445, 82867, 729, 25, 1018, 82, 497, 4185, 2234, 5152, 675, 2398, 30633, 82, 1669, 3056, 917, 515, 197, 197, 63, 2378, 12633, 2336, 14363, 21173, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPinPost(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() Client := th.Client post := th.BasicPost pass, resp := Client.PinPost(post.Id) CheckNoError(t, resp) require.True(t, pass, "should have passed") rpost, err := th.App.GetSinglePost(post.Id) require.Nil(t, err) require.True(t, rpost.IsPinned, "failed to pin post") pass, resp = Client.PinPost("junk") CheckBadRequestStatus(t, resp) require.False(t, pass, "should have failed") _, resp = Client.PinPost(GenerateTestId()) CheckForbiddenStatus(t, resp) t.Run("unable-to-pin-post-in-read-only-town-square", func(t *testing.T) { townSquareIsReadOnly := *th.App.Config().TeamSettings.ExperimentalTownSquareIsReadOnly th.App.SetLicense(model.NewTestLicense()) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = true }) defer th.App.RemoveLicense() defer th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = townSquareIsReadOnly }) channel, err := th.App.GetChannelByName("town-square", th.BasicTeam.Id, true) assert.Nil(t, err) adminPost := th.CreatePostWithClient(th.SystemAdminClient, channel) _, resp = Client.PinPost(adminPost.Id) CheckForbiddenStatus(t, resp) }) Client.Logout() _, resp = Client.PinPost(post.Id) CheckUnauthorizedStatus(t, resp) _, resp = th.SystemAdminClient.PinPost(post.Id) CheckNoError(t, resp) }
explode_data.jsonl/5247
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 530 }
[ 2830, 3393, 19861, 4133, 1155, 353, 8840, 836, 8, 341, 70479, 1669, 18626, 1155, 568, 3803, 15944, 741, 16867, 270, 836, 682, 4454, 741, 71724, 1669, 270, 11716, 271, 51172, 1669, 270, 48868, 4133, 198, 41431, 11, 9039, 1669, 8423, 8293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestScaleUp(t *testing.T) { tc := testCase{ minReplicas: 2, maxReplicas: 6, initialReplicas: 3, desiredReplicas: 5, CPUTarget: 30, reportedLevels: []uint64{300, 500, 700}, reportedCPURequests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")}, } tc.runTest(t) }
explode_data.jsonl/79486
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 179 }
[ 2830, 3393, 6947, 2324, 1155, 353, 8840, 836, 8, 341, 78255, 1669, 54452, 515, 197, 25320, 18327, 52210, 25, 260, 220, 17, 345, 197, 22543, 18327, 52210, 25, 260, 220, 21, 345, 197, 85270, 18327, 52210, 25, 257, 220, 18, 345, 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...
1
func TestGetInstruments(t *testing.T) { symbols, err := client.GetInstruments() if err != nil { t.Error(err) } found := false for _, symbol := range symbols { if symbol == "XBTUSD" { found = true } } if !found { t.Error("Did not find XBTUSD symbol") } }
explode_data.jsonl/13167
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 115 }
[ 2830, 3393, 1949, 641, 37718, 1155, 353, 8840, 836, 8, 341, 1903, 11786, 11, 1848, 1669, 2943, 2234, 641, 37718, 741, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 3964, 340, 197, 532, 58102, 1669, 895, 198, 2023, 8358, 7735, 1669, 2088...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCustomer_ListAllPendingLineItems(t *testing.T) { key := "test api key" var mockResponses invdendpoint.PendingLineItems mockResponseId := int64(1523) mockResponse := new(invdendpoint.PendingLineItem) mockResponse.Id = mockResponseId mockResponse.Name = "Mock Pli" mockResponses = append(mockResponses, *mockResponse) server, err := invdmockserver.New(200, mockResponses, "json", true) if err != nil { t.Fatal(err) } defer server.Close() conn := mockConnection(key, server) defaultEntity := conn.NewCustomer() subjectEntity, err := defaultEntity.ListAllPendingLineItems() if err != nil { t.Fatal("Error with pli", err) } if subjectEntity[0].Name != "Mock Pli" { t.Fatal("Retrieval not correct") } }
explode_data.jsonl/15028
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 272 }
[ 2830, 3393, 12792, 27104, 2403, 32027, 2460, 4353, 1155, 353, 8840, 836, 8, 341, 23634, 1669, 330, 1944, 6330, 1376, 1837, 2405, 7860, 70743, 1529, 67, 32540, 96624, 2460, 4353, 198, 77333, 2582, 764, 1669, 526, 21, 19, 7, 16, 20, 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...
4
func TestIntegrationPolicyChannels(t *testing.T) { t.Parallel() var ( testPolicyNameRandStr = nr.RandSeq(5) testIntegrationPolicy = Policy{ IncidentPreference: "PER_POLICY", Name: fmt.Sprintf("test-alert-policy-%s", testPolicyNameRandStr), } testIntegrationChannelA = Channel{ Name: fmt.Sprintf("test-alert-channel-%s", testPolicyNameRandStr), Type: "slack", Configuration: ChannelConfiguration{ URL: "https://example-org.slack.com", Channel: testPolicyNameRandStr, }, Links: ChannelLinks{ PolicyIDs: []int{}, }, } testIntegrationChannelB = Channel{ Name: fmt.Sprintf("test-alert-channel-%s", nr.RandSeq(5)), Type: "slack", Configuration: ChannelConfiguration{ URL: "https://example-org.slack.com", Channel: nr.RandSeq(5), }, Links: ChannelLinks{ PolicyIDs: []int{}, }, } ) client := newIntegrationTestClient(t) // Setup policyResp, err := client.CreatePolicy(testIntegrationPolicy) policy := *policyResp require.NoError(t, err) channelRespA, err := client.CreateChannel(testIntegrationChannelA) channelRespB, err := client.CreateChannel(testIntegrationChannelB) channelA := *channelRespA channelB := *channelRespB require.NoError(t, err) // Teardown defer func() { _, err = client.DeletePolicy(policy.ID) if err != nil { t.Logf("Error cleaning up alert policy %d (%s): %s", policy.ID, policy.Name, err) } _, err = client.DeleteChannel(channelA.ID) if err != nil { t.Logf("Error cleaning up alert channel %d (%s): %s", channelA.ID, channelA.Name, err) } _, err = client.DeleteChannel(channelB.ID) if err != nil { t.Logf("Error cleaning up alert channel %d (%s): %s", channelB.ID, channelB.Name, err) } }() // Test: Update updateResult, err := client.UpdatePolicyChannels(policy.ID, []int{channelA.ID, channelB.ID}) require.NoError(t, err) require.NotNil(t, updateResult) require.Greater(t, len(updateResult.ChannelIDs), 1) // Test: Delete deleteResultA, err := client.DeletePolicyChannel(policy.ID, updateResult.ChannelIDs[0]) require.NoError(t, err) require.NotNil(t, deleteResultA) deleteResultB, err := client.DeletePolicyChannel(policy.ID, updateResult.ChannelIDs[1]) require.NoError(t, err) require.NotNil(t, deleteResultB) }
explode_data.jsonl/50929
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 888 }
[ 2830, 3393, 52464, 13825, 35925, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 2405, 2399, 197, 18185, 13825, 675, 56124, 2580, 284, 20262, 2013, 437, 20183, 7, 20, 340, 197, 18185, 52464, 13825, 284, 10974, 515, 298, 197, 3924...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRejectUnexpectedServerIDV6(t *testing.T) { req, err := dhcpv6.NewMessage() if err != nil { t.Fatal(err) } v6ServerID = makeTestDUID("0000000000000000") req.MessageType = dhcpv6.MessageTypeSolicit dhcpv6.WithClientID(*makeTestDUID("1000000000000000"))(req) dhcpv6.WithServerID(*makeTestDUID("0000000000000000"))(req) stub, err := dhcpv6.NewAdvertiseFromSolicit(req) if err != nil { t.Fatal(err) } resp, stop := Handler6(req, stub) if resp != nil { t.Error("server_id is sending a response message to a solicit with a ServerID") } if !stop { t.Error("server_id did not interrupt processing on a solicit with a ServerID") } }
explode_data.jsonl/39207
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 247 }
[ 2830, 3393, 78413, 29430, 5475, 915, 53, 21, 1155, 353, 8840, 836, 8, 341, 24395, 11, 1848, 1669, 85787, 85, 21, 7121, 2052, 741, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 5195, 21, 5475, 915, 284, 1281, 2271...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTemplate(t *testing.T) { tablet := topo.NewTablet(0, "cell", "a") ts := []*TabletStats{ { Key: "a", Tablet: tablet, Target: &querypb.Target{Keyspace: "k", Shard: "s", TabletType: topodatapb.TabletType_REPLICA}, Up: true, Serving: false, Stats: &querypb.RealtimeStats{SecondsBehindMaster: 1, CpuUsage: 0.3}, TabletExternallyReparentedTimestamp: 0, }, } tcs := &TabletsCacheStatus{ Cell: "cell", Target: &querypb.Target{Keyspace: "k", Shard: "s", TabletType: topodatapb.TabletType_REPLICA}, TabletsStats: ts, } templ := template.New("").Funcs(status.StatusFuncs) templ, err := templ.Parse(HealthCheckTemplate) if err != nil { t.Fatalf("error parsing template: %v", err) } wr := &bytes.Buffer{} if err := templ.Execute(wr, []*TabletsCacheStatus{tcs}); err != nil { t.Fatalf("error executing template: %v", err) } }
explode_data.jsonl/59734
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 391 }
[ 2830, 3393, 7275, 1155, 353, 8840, 836, 8, 341, 26481, 83, 1669, 72519, 7121, 2556, 83, 7, 15, 11, 330, 5873, 497, 330, 64, 1138, 57441, 1669, 29838, 2556, 83, 16635, 515, 197, 197, 515, 298, 55242, 25, 257, 330, 64, 756, 298, 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 TestBaseMetricListPushBackElemWithForwardingPipeline(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() l, err := newBaseMetricList(testShard, time.Second, nil, nil, nil, testOptions(ctrl)) require.NoError(t, err) elem, err := NewCounterElem(testCounterElemData, NewElemOptions(l.opts)) require.NoError(t, err) // Push a counter to the list. e, err := l.PushBack(elem) require.NoError(t, err) require.Equal(t, 1, l.aggregations.Len()) require.Equal(t, elem, e.Value.(*CounterElem)) require.NotNil(t, elem.writeForwardedMetricFn) require.NotNil(t, elem.onForwardedAggregationWrittenFn) }
explode_data.jsonl/43581
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 247 }
[ 2830, 3393, 3978, 54310, 852, 16644, 3707, 25586, 2354, 25925, 287, 34656, 1155, 353, 8840, 836, 8, 341, 84381, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 16867, 23743, 991, 18176, 2822, 8810, 11, 1848, 1669, 501, 3978, 54310, 852, 86...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestOpenReportFailure(t *testing.T) { if testing.Short() { t.Skip("skip test in short mode") } server := httptest.NewServer(http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }, )) defer server.Close() sess := newSessionForTestingNoBackendsLookup(t) defer sess.Close() builder, err := sess.NewExperimentBuilder("example") if err != nil { t.Fatal(err) } exp := builder.NewExperiment() exp.session.selectedProbeService = &model.Service{ Address: server.URL, Type: "https", } err = exp.OpenReport() if !strings.HasPrefix(err.Error(), "httpx: request failed") { t.Fatal("not the error we expected") } }
explode_data.jsonl/26322
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 259 }
[ 2830, 3393, 5002, 10361, 17507, 1155, 353, 8840, 836, 8, 341, 743, 7497, 55958, 368, 341, 197, 3244, 57776, 445, 20599, 1273, 304, 2805, 3856, 1138, 197, 532, 41057, 1669, 54320, 70334, 7121, 5475, 19886, 89164, 1006, 197, 29244, 3622, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMakePostgresqlUserRespository(t *testing.T) { db, mock, err := sqlmock.New() if err != nil { t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) } defer db.Close() _, err = repository.MakePostgresqlUserRespository(pgEmpty, db) ok(t, err) ok(t, mock.ExpectationsWereMet()) }
explode_data.jsonl/3816
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 122 }
[ 2830, 3393, 8078, 4133, 81624, 1474, 1061, 3099, 1155, 353, 8840, 836, 8, 341, 20939, 11, 7860, 11, 1848, 1669, 5704, 16712, 7121, 741, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 276, 1465, 7677, 82, 6, 572, 537, 3601, 979, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClusterAdminCreateTopicWithInvalidTopicDetail(t *testing.T) { seedBroker := NewMockBroker(t, 1) defer seedBroker.Close() seedBroker.SetHandlerByMap(map[string]MockResponse{ "MetadataRequest": NewMockMetadataResponse(t). SetController(seedBroker.BrokerID()). SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), "CreateTopicsRequest": NewMockCreateTopicsResponse(t), }) config := NewTestConfig() config.Version = V0_10_2_0 admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) if err != nil { t.Fatal(err) } err = admin.CreateTopic("my_topic", nil, false) if err.Error() != "you must specify topic details" { t.Fatal(err) } err = admin.Close() if err != nil { t.Fatal(err) } }
explode_data.jsonl/40778
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 284 }
[ 2830, 3393, 28678, 7210, 4021, 26406, 2354, 7928, 26406, 10649, 1155, 353, 8840, 836, 8, 341, 197, 22602, 65545, 1669, 1532, 11571, 65545, 1155, 11, 220, 16, 340, 16867, 10320, 65545, 10421, 2822, 197, 22602, 65545, 4202, 3050, 1359, 2227...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestKeyCommonPrefixLen(t *testing.T) { key := Key{} require.Equal(t, Depth(0), key.CommonPrefixLen(0, Key{}, 0)) key = Key{0xff, 0xff} require.Equal(t, Depth(16), key.CommonPrefixLen(16, Key{0xff, 0xff, 0xff}, 24)) key = Key{0xff, 0xff, 0xff} require.Equal(t, Depth(16), key.CommonPrefixLen(24, Key{0xff, 0xff}, 16)) key = Key{0xff, 0xff, 0xff} require.Equal(t, Depth(24), key.CommonPrefixLen(24, Key{0xff, 0xff, 0xff}, 24)) key = Key{0xab, 0xcd, 0xef, 0xff} require.Equal(t, Depth(23), key.CommonPrefixLen(32, Key{0xab, 0xcd, 0xee, 0xff}, 32)) }
explode_data.jsonl/41422
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 257 }
[ 2830, 3393, 1592, 10839, 14335, 11271, 1155, 353, 8840, 836, 8, 341, 23634, 1669, 5309, 16094, 17957, 12808, 1155, 11, 43920, 7, 15, 701, 1376, 16010, 14335, 11271, 7, 15, 11, 5309, 22655, 220, 15, 4390, 23634, 284, 5309, 90, 15, 9020...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1