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 TestYouonMSpecial(t *testing.T) { const want = "mamimumemomwamyumi" for _, v := range [2]string{"むぁむぃむぅむぇむぉむゎむゅめぃ", "ムァムィムゥムェムォムヮムュメィ"} { got, err := KanaToRomaji(v) assert.Equal(t, want, got) assert.Nil(t, err) } }
explode_data.jsonl/11335
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 142 }
[ 2830, 3393, 2610, 263, 4826, 2964, 1155, 353, 8840, 836, 8, 341, 4777, 1366, 284, 330, 76, 309, 3295, 336, 316, 86, 26228, 24336, 1837, 2023, 8358, 348, 1669, 2088, 508, 17, 30953, 4913, 125471, 126025, 125471, 144205, 125471, 144260, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFindHook_ListError(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() remote := mockscm.NewMockRepositoryService(controller) remote.EXPECT().ListHooks(gomock.Any(), "octocat/hello-world", gomock.Any()).Return(nil, nil, io.EOF) client := new(scm.Client) client.Repositories = remote _, err := findHook(context.Background(), client, "octocat/hello-world", "core.company.com") if err == nil { t.Errorf("Want hook request failure to return error") } }
explode_data.jsonl/40649
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 176 }
[ 2830, 3393, 9885, 31679, 27104, 1454, 1155, 353, 8840, 836, 8, 341, 61615, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 16867, 6461, 991, 18176, 2822, 197, 18147, 1669, 7860, 2388, 76, 7121, 11571, 4624, 1860, 40845, 340, 197, 18147, 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...
2
func TestCanCreateUser(t *testing.T) { givenThereAreCleanDependencies() givenIHaveCreatedAUser("asd2", model.User{Name: "Tom", AuthenticationID: "asd2", EmailAddress: "email@", DateCreated: time.Now()}, t) whenIGetAUserWithTheID("asd2", 1, t) thenTheFollowingIsReturned(model.User{ID: 1, Name: "Tom", AuthenticationID: "asd2"}, t) }
explode_data.jsonl/23634
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 123 }
[ 2830, 3393, 6713, 4021, 1474, 1155, 353, 8840, 836, 8, 341, 3174, 2071, 3862, 11526, 27529, 48303, 741, 3174, 2071, 40, 12116, 11694, 32, 1474, 445, 79102, 17, 497, 1614, 7344, 63121, 25, 330, 24732, 497, 23537, 915, 25, 330, 79102, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetTemplate(t *testing.T) { ctx := context.Background() expectation := func(t *testing.T, input *workflow.Workflow, tinkDB *db.TinkDB) { wID, wName, wData, err := tinkDB.GetTemplate(ctx, map[string]string{"id": input.ID}, false) if err != nil { t.Error(err) } w := workflow.MustParse([]byte(wData)) w.ID = wID w.Name = wName if dif := cmp.Diff(input, w); dif != "" { t.Errorf(dif) } } tests := []struct { // Name identifies the single test in a table test scenario Name string // Input is a list of workflows that will be used to pre-populate the database Input []*workflow.Workflow // GetAsync if set to true gets all the templates concurrently GetAsync bool // Expectation is the function used to apply the assertions. // You can use it to validate if you get template you expected Expectation func(*testing.T, *workflow.Workflow, *db.TinkDB) }{ { Name: "get-template", Input: []*workflow.Workflow{ func() *workflow.Workflow { w := workflow.MustParseFromFile("./testdata/template_happy_path_1.yaml") w.ID = "545f7ce9-5313-49c6-8704-0ed98814f1f7" return w }(), }, Expectation: expectation, }, { Name: "stress-get-template", GetAsync: true, Input: func() []*workflow.Workflow { input := []*workflow.Workflow{} for i := 0; i < 20; i++ { w := workflow.MustParseFromFile("./testdata/template_happy_path_1.yaml") w.ID = uuid.New().String() w.Name = fmt.Sprintf("id_%d", rand.Int()) t.Log(w.Name) input = append(input, w) } return input }(), Expectation: expectation, }, } for _, s := range tests { t.Run(s.Name, func(t *testing.T) { t.Parallel() _, tinkDB, cl := NewPostgresDatabaseClient(t, ctx, NewPostgresDatabaseRequest{ ApplyMigration: true, }) defer func() { err := cl() if err != nil { t.Error(err) } }() for _, in := range s.Input { err := createTemplateFromWorkflowType(ctx, tinkDB, in) if err != nil { t.Error(err) } } var wg sync.WaitGroup wg.Add(len(s.Input)) for _, in := range s.Input { if s.GetAsync { go func(t *testing.T, wf *workflow.Workflow, db *db.TinkDB) { defer wg.Done() s.Expectation(t, wf, db) }(t, in, tinkDB) } else { wg.Done() s.Expectation(t, in, tinkDB) } } wg.Wait() }) } }
explode_data.jsonl/65344
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1090 }
[ 2830, 3393, 1949, 7275, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 24952, 367, 1669, 2915, 1155, 353, 8840, 836, 11, 1946, 353, 56249, 28748, 4965, 11, 90584, 3506, 353, 1999, 836, 766, 3506, 8, 341, 197, 6692, 915, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClientCloseHandshake(t *testing.T) { clientConfig := transport.NewConfig() clientConfig.TLS = &tls.Config{ ServerName: "quic", } s, c := newPipe(nil, clientConfig) closeCh := make(chan struct{}, 2) s.SetHandler(handlerFunc(func(conn *Conn, events []transport.Event) { if len(events) != 1 || events[0].Type != transport.EventConnClosed { t.Errorf("expect only close event, got %v", events) } closeCh <- struct{}{} })) defer s.Close() go s.Serve() c.SetHandler(handlerFunc(func(conn *Conn, events []transport.Event) { if len(events) != 1 || events[0].Type != transport.EventConnClosed { t.Errorf("expect only close event, got %v", events) } closeCh <- struct{}{} })) defer c.Close() go c.Serve() err := c.Connect(s.LocalAddr().String()) if err != nil { t.Fatal(err) } timeout := time.After(5 * time.Second) for i := 0; i < 2; i++ { select { case <-closeCh: case <-timeout: t.Errorf("receive timed out") } } }
explode_data.jsonl/13464
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 394 }
[ 2830, 3393, 2959, 7925, 2314, 29661, 1155, 353, 8840, 836, 8, 341, 25291, 2648, 1669, 7557, 7121, 2648, 741, 25291, 2648, 836, 7268, 284, 609, 34488, 10753, 515, 197, 92075, 675, 25, 330, 446, 292, 756, 197, 532, 1903, 11, 272, 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 TestReversiAnz17(t *testing.T) { r := NewReversiAnz() r.SetEdgeSideThreeCnt(1) if r.GetEdgeSideThreeCnt() != 1 { t.Errorf("NG") } }
explode_data.jsonl/23040
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 70 }
[ 2830, 3393, 693, 3004, 72, 2082, 89, 16, 22, 1155, 353, 8840, 836, 8, 341, 7000, 1669, 1532, 693, 3004, 72, 2082, 89, 741, 7000, 4202, 11656, 16384, 19641, 33747, 7, 16, 340, 743, 435, 2234, 11656, 16384, 19641, 33747, 368, 961, 220...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
func TestParseMessage(t *testing.T) { r := prework() var evt Event msg := `{"event":"error","msg":"Contract does not exist.","code":"51001"}` evt, _, _ = r.parseMessage([]byte(msg)) assert.True(t, EVENT_ERROR == evt) msg = `{"event":"error","msg":"channel:positions,ccy:BTC doesn't exist","code":"60018"}` evt, _, _ = r.parseMessage([]byte(msg)) assert.True(t, EVENT_BOOK_POSTION == evt) }
explode_data.jsonl/61328
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 153 }
[ 2830, 3393, 14463, 2052, 1155, 353, 8840, 836, 8, 341, 7000, 1669, 855, 1778, 741, 2405, 12358, 3665, 198, 21169, 1669, 1565, 4913, 3087, 3252, 841, 2198, 3236, 3252, 14067, 1558, 537, 3000, 47891, 1851, 3252, 20, 16, 15, 15, 16, 1, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestRoundUp(t *testing.T) { for _, tt := range roundUpTests { actual := testing.RoundUp(tt.v) if tt.expected != actual { t.Errorf("roundUp(%d): expected %d, actual %d", tt.v, tt.expected, actual) } } }
explode_data.jsonl/33936
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 95 }
[ 2830, 3393, 27497, 2324, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 17853, 1669, 2088, 4778, 2324, 18200, 341, 197, 88814, 1669, 7497, 37646, 2324, 47152, 3133, 340, 197, 743, 17853, 56835, 961, 5042, 341, 298, 3244, 13080, 445, 1049, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestInsertShardedOwnedWithNull(t *testing.T) { invschema := &vschemapb.SrvVSchema{ Keyspaces: map[string]*vschemapb.Keyspace{ "sharded": { Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "hash": { Type: "hash", }, "onecol": { Type: "lookup", Params: map[string]string{ "table": "lkp1", "from": "from", "to": "toc", }, Owner: "t1", }, }, Tables: map[string]*vschemapb.Table{ "t1": { ColumnVindexes: []*vschemapb.ColumnVindex{{ Name: "hash", Columns: []string{"id"}, }, { Name: "onecol", Columns: []string{"c3"}, }}, }, }, }, }, } vs, err := vindexes.BuildVSchema(invschema) if err != nil { t.Fatal(err) } ks := vs.Keyspaces["sharded"] ins := NewInsert( InsertSharded, ks.Keyspace, []sqltypes.PlanValue{{ // colVindex columns: id Values: []sqltypes.PlanValue{{ // rows for id Values: []sqltypes.PlanValue{{ Value: sqltypes.NewInt64(1), }}, }}, }, { // colVindex columns: c3 Values: []sqltypes.PlanValue{{ // rows for c3 Values: []sqltypes.PlanValue{{ Value: sqltypes.NULL, }}, }}, }}, ks.Tables["t1"], "prefix", []string{" mid1", " mid2", " mid3"}, " suffix", ) vc := &loggingVCursor{ shards: []string{"-20", "20-"}, shardForKsid: []string{"20-", "-20", "20-"}, } _, err = ins.Execute(vc, map[string]*querypb.BindVariable{}, false) if err != nil { t.Fatal(err) } vc.ExpectLog(t, []string{ `Execute insert into lkp1(from, toc) values(:from0, :toc0) from0: toc0: type:VARBINARY ` + `value:"\026k@\264J\272K\326" true`, `ResolveDestinations sharded [value:"0" ] Destinations:DestinationKeyspaceID(166b40b44aba4bd6)`, `ExecuteMultiShard sharded.20-: prefix mid1 suffix /* vtgate:: keyspace_id:166b40b44aba4bd6 */ ` + `{_c30: _id0: type:INT64 value:"1" } true true`, }) }
explode_data.jsonl/55990
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 995 }
[ 2830, 3393, 13780, 2016, 20958, 57641, 2354, 3280, 1155, 353, 8840, 836, 8, 341, 17430, 11562, 3416, 1669, 609, 11562, 2407, 391, 65, 808, 10553, 53, 8632, 515, 197, 197, 8850, 27338, 25, 2415, 14032, 8465, 11562, 2407, 391, 65, 37863, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCreateCSIVolumeResponse(t *testing.T) { volumeID := "volID" threeIops := "3" testCases := []struct { testCaseName string requestVol provider.Volume requestCap int64 requestZones []string clusterID string expectedVolume *csi.CreateVolumeResponse expectedStatus bool }{ { testCaseName: "Valid volume response", requestVol: provider.Volume{VolumeID: volumeID, VPCVolume: provider.VPCVolume{VPCBlockVolume: provider.VPCBlockVolume{ Tags: []string{createdByIBM}, }, Profile: &provider.Profile{Name: "general-purpose"}, ResourceGroup: &provider.ResourceGroup{ID: "myresourcegroups"}, }, Region: "us-south-test", Iops: &threeIops, Az: "testzone", }, requestCap: 20, clusterID: "1234", requestZones: []string{"", ""}, expectedVolume: &csi.CreateVolumeResponse{ Volume: &csi.Volume{ CapacityBytes: 20, VolumeId: volumeID, VolumeContext: map[string]string{VolumeIDLabel: volumeID, IOPSLabel: threeIops, utils.NodeRegionLabel: "us-south-test", utils.NodeZoneLabel: "testzone"}, AccessibleTopology: []*csi.Topology{{ Segments: map[string]string{ utils.NodeRegionLabel: "us-south-test", utils.NodeZoneLabel: "testzone", }, }, }, }, }, expectedStatus: true, }, } for _, testcase := range testCases { t.Run(testcase.testCaseName, func(t *testing.T) { actualCSIVolume := createCSIVolumeResponse(testcase.requestVol, testcase.requestCap, testcase.requestZones, testcase.clusterID) assert.Equal(t, testcase.expectedStatus, isCSIResponseSame(testcase.expectedVolume, actualCSIVolume)) }) } }
explode_data.jsonl/51260
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 708 }
[ 2830, 3393, 4021, 6412, 3090, 4661, 2582, 1155, 353, 8840, 836, 8, 341, 5195, 4661, 915, 1669, 330, 12536, 915, 698, 197, 27856, 40, 3721, 1669, 330, 18, 698, 18185, 37302, 1669, 3056, 1235, 341, 197, 18185, 4207, 675, 256, 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...
1
func TestDecodeEmbeddedField(t *testing.T) { Convey("Given a struct having embedded fields and when decode it", t, func() { type S1 struct { A int B string } type S2 struct { C int D string } s := struct { S1 *S2 B float64 `bql:",weaklytyped"` // intentional E int C int `bql:"cc"` // also intentional }{} err := Decode(Map{ "a": Int(1), "b": String("2"), "c": Int(3), "d": String("4"), "e": Int(5), "cc": Int(6), }, &s) So(err, ShouldBeNil) Convey("Then the struct has correct values", func() { So(s.A, ShouldEqual, 1) So(s.B, ShouldEqual, 2) So(s.C, ShouldEqual, 6) So(s.D, ShouldEqual, "4") So(s.E, ShouldEqual, 5) }) Convey("Then S1 has correct values", func() { So(s.S1.A, ShouldEqual, 1) So(s.S1.B, ShouldEqual, "2") }) Convey("Then S2 has correct values", func() { So(s.S2.C, ShouldEqual, 3) So(s.S2.D, ShouldEqual, "4") }) }) Convey("Given a struct having a unsupported embedded field type", t, func() { Convey("When the struct have embedded time.Time", func() { s := struct { time.Time }{} Convey("Then decoding should fail", func() { So(Decode(Map{}, &s), ShouldNotBeNil) }) }) Convey("When the struct have embedded Timestamp", func() { s := struct { Timestamp }{} Convey("Then decoding should fail", func() { So(Decode(Map{}, &s), ShouldNotBeNil) }) }) Convey("When the struct have non-struct embedded field", func() { s := struct { Int }{} Convey("Then decoding should fail", func() { So(Decode(Map{}, &s), ShouldNotBeNil) }) }) }) }
explode_data.jsonl/44422
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 753 }
[ 2830, 3393, 32564, 83466, 1877, 1155, 353, 8840, 836, 8, 341, 93070, 5617, 445, 22043, 264, 2036, 3432, 22864, 5043, 323, 979, 16895, 432, 497, 259, 11, 2915, 368, 341, 197, 13158, 328, 16, 2036, 341, 298, 22985, 526, 198, 298, 12791,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestBadlyVersionedModule(t *testing.T) { testenv.NeedsGo1Point(t, 14) const proxy = ` -- example.com/blah/@v/v1.0.0.mod -- module example.com go 1.12 -- example.com/blah@v1.0.0/blah.go -- package blah const Name = "Blah" -- example.com/blah/v2/@v/v2.0.0.mod -- module example.com go 1.12 -- example.com/blah/v2@v2.0.0/blah.go -- package blah import "example.com/blah" var _ = blah.Name const Name = "Blah" ` const files = ` -- go.mod -- module mod.com go 1.12 require example.com/blah/v2 v2.0.0 -- main.go -- package main import "example.com/blah/v2" var _ = blah.Name ` withOptions(WithProxyFiles(proxy)).run(t, files, func(t *testing.T, env *Env) { env.OpenFile("main.go") env.OpenFile("go.mod") var d protocol.PublishDiagnosticsParams env.Await( OnceMet( DiagnosticAt("go.mod", 0, 0), ReadDiagnostics("go.mod", &d), ), ) env.ApplyQuickFixes("main.go", d.Diagnostics) const want = `module mod.com go 1.12 require ( example.com/blah v1.0.0 // indirect example.com/blah/v2 v2.0.0 ) ` env.Await(EmptyDiagnostics("go.mod")) if got := env.Editor.BufferText("go.mod"); got != want { t.Fatalf("suggested fixes failed:\n%s", tests.Diff(want, got)) } }) }
explode_data.jsonl/3744
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 545 }
[ 2830, 3393, 17082, 398, 5637, 291, 3332, 1155, 353, 8840, 836, 8, 341, 18185, 3160, 2067, 68, 6767, 10850, 16, 2609, 1155, 11, 220, 16, 19, 692, 4777, 13291, 284, 22074, 313, 3110, 905, 14, 70614, 38662, 85, 5457, 16, 13, 15, 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...
2
func TestDB_reloadOrder(t *testing.T) { db, delete := openTestDB(t, nil) defer func() { testutil.Ok(t, db.Close()) delete() }() metas := []BlockMeta{ {MinTime: 90, MaxTime: 100}, {MinTime: 70, MaxTime: 80}, {MinTime: 100, MaxTime: 110}, } for _, m := range metas { createBlock(t, db.Dir(), genSeries(1, 1, m.MinTime, m.MaxTime)) } testutil.Ok(t, db.reload()) blocks := db.Blocks() testutil.Equals(t, 3, len(blocks)) testutil.Equals(t, metas[1].MinTime, blocks[0].Meta().MinTime) testutil.Equals(t, metas[1].MaxTime, blocks[0].Meta().MaxTime) testutil.Equals(t, metas[0].MinTime, blocks[1].Meta().MinTime) testutil.Equals(t, metas[0].MaxTime, blocks[1].Meta().MaxTime) testutil.Equals(t, metas[2].MinTime, blocks[2].Meta().MinTime) testutil.Equals(t, metas[2].MaxTime, blocks[2].Meta().MaxTime) }
explode_data.jsonl/64359
{ "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, 3506, 79405, 4431, 1155, 353, 8840, 836, 8, 341, 20939, 11, 3698, 1669, 1787, 2271, 3506, 1155, 11, 2092, 340, 16867, 2915, 368, 341, 197, 18185, 1314, 54282, 1155, 11, 2927, 10421, 2398, 197, 15618, 741, 197, 66816, 2109, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNextElement(t *testing.T) { s := NewSet() e := "dummy" s.Add(e) iter, err := s.NewIterator() if err != nil { t.Fail() } key, err := iter.Next() if key == nil || err != nil { t.Fail() } if iter.HasMore() { t.Fail() } }
explode_data.jsonl/16579
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 116 }
[ 2830, 3393, 5847, 1691, 1155, 353, 8840, 836, 8, 341, 1903, 1669, 1532, 1649, 741, 7727, 1669, 330, 31390, 698, 1903, 1904, 2026, 340, 79924, 11, 1848, 1669, 274, 7121, 11951, 2822, 743, 1848, 961, 2092, 341, 197, 3244, 57243, 741, 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...
5
func TestChangeStream_trackResumeToken(t *testing.T) { t.Parallel() if testing.Short() { t.Skip() } skipIfBelow36(t) if os.Getenv("TOPOLOGY") != "replica_set" { t.Skip() } coll := createTestCollection(t, nil, nil) // Ensure the database is created. _, err := coll.InsertOne(context.Background(), bson.NewDocument(bson.EC.Int32("y", 1))) require.NoError(t, err) changes, err := coll.Watch(context.Background(), nil) require.NoError(t, err) for i := 1; i <= 4; i++ { _, err = coll.InsertOne(context.Background(), bson.NewDocument(bson.EC.Interface("x", i))) require.NoError(t, err) } for i := 1; i <= 4; i++ { getNextChange(changes) doc := bson.NewDocument() err := changes.Decode(doc) require.NoError(t, err) id, err := doc.LookupErr("_id") require.NoError(t, err) require.Equal(t, id.MutableDocument(), changes.(*changeStream).resumeToken) } }
explode_data.jsonl/68238
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 354 }
[ 2830, 3393, 4072, 3027, 28545, 28563, 3323, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 743, 7497, 55958, 368, 341, 197, 3244, 57776, 741, 197, 532, 1903, 13389, 2679, 38214, 18, 21, 1155, 692, 743, 2643, 64883, 445, 5207, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMcfgFromConfig(t *testing.T) { falseVar := false tests := []struct { name string config *conf.C expected ModuleConfig }{ { name: "disable fileset", config: load(t, map[string]interface{}{ "module": "nginx", "error.enabled": false, }), expected: ModuleConfig{ Module: "nginx", Filesets: map[string]*FilesetConfig{ "error": { Enabled: &falseVar, Var: nil, Input: nil, }, }, }, }, { name: "set variable", config: load(t, map[string]interface{}{ "module": "nginx", "access.var.test": false, }), expected: ModuleConfig{ Module: "nginx", Filesets: map[string]*FilesetConfig{ "access": { Var: map[string]interface{}{ "test": false, }, Input: nil, }, }, }, }, { name: "empty fileset (nil)", config: load(t, map[string]interface{}{ "module": "nginx", "error": nil, }), expected: ModuleConfig{ Module: "nginx", Filesets: map[string]*FilesetConfig{ "error": {}, }, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { result, err := mcfgFromConfig(test.config) require.NoError(t, err) assert.Equal(t, test.expected.Module, result.Module) assert.Equal(t, len(test.expected.Filesets), len(result.Filesets)) for name, fileset := range test.expected.Filesets { assert.Equal(t, fileset, result.Filesets[name]) } }) } }
explode_data.jsonl/64758
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 714 }
[ 2830, 3393, 44, 14072, 3830, 2648, 1155, 353, 8840, 836, 8, 341, 36012, 3962, 1669, 895, 198, 78216, 1669, 3056, 1235, 341, 197, 11609, 257, 914, 198, 197, 25873, 256, 353, 6135, 727, 198, 197, 42400, 13711, 2648, 198, 197, 59403, 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...
2
func TestInvokeBadRWSet(t *testing.T) { t.Run("1.2Capability", func(t *testing.T) { l, v, cleanup := setupLedgerAndValidatorWithV12Capabilities(t) defer cleanup() testInvokeBadRWSet(t, l, v) }) t.Run("1.3Capability", func(t *testing.T) { l, v, cleanup := setupLedgerAndValidatorWithV13Capabilities(t) defer cleanup() testInvokeBadRWSet(t, l, v) }) }
explode_data.jsonl/47795
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 157 }
[ 2830, 3393, 17604, 17082, 56368, 1649, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 16, 13, 17, 63746, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 8810, 11, 348, 11, 21290, 1669, 6505, 60850, 1389, 3036, 14256, 2354, 53, 16, 17...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestNewNopExtensionFactory(t *testing.T) { factory := NewNopExtensionFactory() require.NotNil(t, factory) assert.Equal(t, config.Type("nop"), factory.Type()) cfg := factory.CreateDefaultConfig() assert.Equal(t, &config.ExtensionSettings{TypeVal: factory.Type()}, cfg) traces, err := factory.CreateExtension(context.Background(), component.ExtensionCreateParams{}, cfg) require.NoError(t, err) assert.NoError(t, traces.Start(context.Background(), NewNopHost())) assert.NoError(t, traces.Shutdown(context.Background())) }
explode_data.jsonl/52612
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 181 }
[ 2830, 3393, 3564, 45, 453, 12049, 4153, 1155, 353, 8840, 836, 8, 341, 1166, 2919, 1669, 1532, 45, 453, 12049, 4153, 741, 17957, 93882, 1155, 11, 8633, 340, 6948, 12808, 1155, 11, 2193, 10184, 445, 62813, 3975, 8633, 10184, 2398, 50286, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSetProject(t *testing.T) { fixture.EnsureCleanState(t) projectName := "proj-" + strconv.FormatInt(time.Now().Unix(), 10) _, err := fixture.AppClientset.ArgoprojV1alpha1().AppProjects(fixture.ArgoCDNamespace).Create( context.Background(), &v1alpha1.AppProject{ObjectMeta: metav1.ObjectMeta{Name: projectName}}, metav1.CreateOptions{}) assert.NoError(t, err) _, err = fixture.RunCli("proj", "set", projectName, "--description", "updated description", "-d", "https://192.168.99.100:8443,default", "-d", "https://192.168.99.100:8443,service", "--orphaned-resources-warn=false") assert.NoError(t, err) proj, err := fixture.AppClientset.ArgoprojV1alpha1().AppProjects(fixture.ArgoCDNamespace).Get(context.Background(), projectName, metav1.GetOptions{}) assert.NoError(t, err) assert.Equal(t, projectName, proj.Name) assert.Equal(t, 2, len(proj.Spec.Destinations)) assert.Equal(t, "https://192.168.99.100:8443", proj.Spec.Destinations[0].Server) assert.Equal(t, "default", proj.Spec.Destinations[0].Namespace) assert.Equal(t, "https://192.168.99.100:8443", proj.Spec.Destinations[1].Server) assert.Equal(t, "service", proj.Spec.Destinations[1].Namespace) assert.NotNil(t, proj.Spec.OrphanedResources) assert.False(t, proj.Spec.OrphanedResources.IsWarn()) assertProjHasEvent(t, proj, "update", argo.EventReasonResourceUpdated) }
explode_data.jsonl/58440
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 527 }
[ 2830, 3393, 1649, 7849, 1155, 353, 8840, 836, 8, 341, 1166, 12735, 22834, 19098, 27529, 1397, 1155, 692, 72470, 675, 1669, 330, 30386, 27651, 488, 33317, 9978, 1072, 9730, 13244, 1005, 55832, 1507, 220, 16, 15, 340, 197, 6878, 1848, 166...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNodePool_MinSize(t *testing.T) { minSize := 2 np := NodePool{minSize: minSize} if np.MinSize() != minSize { t.Errorf("got %d expected %d", np.MaxSize(), minSize) } }
explode_data.jsonl/71597
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 74 }
[ 2830, 3393, 1955, 10551, 62122, 1695, 1155, 353, 8840, 836, 8, 341, 25320, 1695, 1669, 220, 17, 198, 197, 6199, 1669, 6018, 10551, 90, 1065, 1695, 25, 1308, 1695, 532, 743, 2595, 17070, 1695, 368, 961, 1308, 1695, 341, 197, 3244, 1308...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMountOnExisting(t *testing.T) { ts := NewTestCase(t) defer ts.Cleanup() err := os.Mkdir(ts.mnt+"/mnt", 0777) if err != nil { t.Fatalf("Mkdir failed: %v", err) } nfs := nodefs.NewDefaultNode() code := ts.connector.Mount(ts.rootNode(), "mnt", nfs, nil) if code != fuse.EBUSY { t.Fatal("expect EBUSY:", code) } err = os.Remove(ts.mnt + "/mnt") if err != nil { t.Fatalf("Remove failed: %v", err) } code = ts.connector.Mount(ts.rootNode(), "mnt", nfs, nil) if !code.Ok() { t.Fatal("expect OK:", code) } code = ts.pathFs.Unmount("mnt") if !code.Ok() { t.Errorf("Unmount failed: %v", code) } }
explode_data.jsonl/9153
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 294 }
[ 2830, 3393, 16284, 1925, 53067, 1155, 353, 8840, 836, 8, 341, 57441, 1669, 1532, 16458, 1155, 340, 16867, 10591, 727, 60639, 2822, 9859, 1669, 2643, 1321, 12438, 35864, 744, 406, 27569, 40882, 497, 220, 15, 22, 22, 22, 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...
6
func TestCallActorWithTracing(t *testing.T) { port, _ := freeport.GetFreePort() server, _ := startTestServerWithTracing(port) defer server.Stop() clientConn := createTestClient(port) defer clientConn.Close() client := internalv1pb.NewServiceInvocationClient(clientConn) request := invokev1.NewInvokeMethodRequest("method") request.WithActor("test-actor", "actor-1") resp, err := client.CallActor(context.Background(), request.Proto()) assert.NoError(t, err) assert.NotEmpty(t, resp.GetMessage(), "failed to generate trace context with actor call") }
explode_data.jsonl/21723
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 178 }
[ 2830, 3393, 7220, 18870, 2354, 1282, 4527, 1155, 353, 8840, 836, 8, 341, 52257, 11, 716, 1669, 1910, 403, 2234, 10940, 7084, 2822, 41057, 11, 716, 1669, 1191, 2271, 5475, 2354, 1282, 4527, 21230, 340, 16867, 3538, 30213, 2822, 25291, 97...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCasualDateCasualTime(t *testing.T) { fixt := []Fixture{ {"Это нужно сделать завтра после обеда", 33, "завтра после обеда", (15 + 24) * time.Hour}, {"Это нужно сделать завтра утром", 33, "завтра утром", (8 + 24) * time.Hour}, {"Это нужно было сделать вчера утром", 42, "вчера утром", (8 - 24) * time.Hour}, {"Это нужно было сделать вчера после обеда", 42, "вчера после обеда", (15 - 24) * time.Hour}, {"помыть окна до вечера", 22, "до вечера", 18 * time.Hour}, {"помыть окна до обеда", 22, "до обеда", 12 * time.Hour}, {"сделать это к вечеру", 22, "к вечеру", 18 * time.Hour}, {"помыть окна завтра утром", 22, "завтра утром", 32 * time.Hour}, {"написать письмо во вторник после обеда", 50, "после обеда", 15 * time.Hour}, {"написать письмо до утра ", 30, "до утра", 8 * time.Hour}, {"к вечеру", 0, "к вечеру", 18 * time.Hour}, } w := when.New(nil) w.Add( ru.CasualDate(rules.Skip), ru.CasualTime(rules.Override), ) ApplyFixtures(t, "ru.CasualDate|ru.CasualTime", w, fixt) }
explode_data.jsonl/8564
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 733 }
[ 2830, 3393, 49242, 928, 1916, 49242, 928, 1462, 1155, 353, 8840, 836, 8, 341, 1166, 941, 83, 1669, 3056, 18930, 515, 197, 197, 4913, 92211, 24634, 129100, 130965, 92223, 128955, 128693, 21229, 13103, 1478, 497, 220, 18, 18, 11, 330, 143...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_humaniseBytes(t *testing.T) { assert.Equal(t, "1.00 KiB", humaniseBytes(int64(1024))) assert.Equal(t, "1.50 KiB", humaniseBytes(int64(1540))) assert.Equal(t, "5.50 MiB", humaniseBytes(int64(5767168))) assert.Equal(t, "40.70 GiB", humaniseBytes(int64(43701292236))) }
explode_data.jsonl/56637
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 123 }
[ 2830, 3393, 86247, 1064, 7078, 1155, 353, 8840, 836, 8, 341, 6948, 12808, 1155, 11, 330, 16, 13, 15, 15, 29458, 33, 497, 3738, 1064, 7078, 1548, 21, 19, 7, 16, 15, 17, 19, 5929, 6948, 12808, 1155, 11, 330, 16, 13, 20, 15, 29458,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDateTime(t *testing.T) { s := "D:2017" doParseDateTimeOK(s, t) //UTF-8 bytes for UTF-16 string "D:2017" s = "\xfe\xff\x00\x44\x00\x3A\x00\x32\x00\x30\x00\x31\x00\x37" doParseDateTimeOK(s, t) s = "D:201703" doParseDateTimeOK(s, t) s = "D:20170430" doParseDateTimeOK(s, t) s = "D:2017043015" doParseDateTimeOK(s, t) s = "D:201704301559" doParseDateTimeOK(s, t) s = "D:20170430155901" doParseDateTimeOK(s, t) s = "D:20170430155901Z" doParseDateTimeOK(s, t) s = "D:20170430155901+06'" doParseDateTimeOK(s, t) s = "D:20170430155901+06'59'" doParseDateTimeOK(s, t) s = "D:20170430155901Z00'" doParseDateTimeOK(s, t) s = "D:20170430155901Z00'00'" doParseDateTimeOK(s, t) s = "D:20170430155901Z" doParseDateTimeOK(s, t) s = "D:20201222164228Z'" doParseDateTimeOK(s, t) s = "D:20170430155901+06'59" doParseDateTimeFail(s, t) s = "D:20170430155901+66'A9'" doParseDateTimeFail(s, t) }
explode_data.jsonl/66908
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 505 }
[ 2830, 3393, 7689, 1155, 353, 8840, 836, 8, 1476, 1903, 1669, 330, 35, 25, 17, 15, 16, 22, 698, 19935, 14463, 7689, 3925, 1141, 11, 259, 692, 197, 322, 8561, 12, 23, 5820, 369, 20076, 12, 16, 21, 914, 330, 35, 25, 17, 15, 16, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGetTicker(t *testing.T) { ctrl := gomock.NewController(t) client := NewMockclient(ctrl) client.EXPECT().request(&clientOption{ endpoint: publicApiEndpoint, method: http.MethodGet, path: fmt.Sprintf(formatTicker, entity.PairBtcJpy), }).Return( []byte(`{"success":1,"data":{"sell":"1020979","buy":"1020712","high":"1023889","low":"963930","last":"1020984","vol":"2075.8257","timestamp":1524573765864}}`), nil, ) api := &APIImpl{ client: client, } ticker, err := api.GetTicker(entity.PairBtcJpy) assert.Nil(t, err) assert.NotNil(t, ticker) assert.Equal(t, 1020712.0, ticker.Buy) assert.Equal(t, 1020979.0, ticker.Sell) assert.Equal(t, 1023889.0, ticker.High) assert.Equal(t, 963930.0, ticker.Low) assert.Equal(t, 1020984.0, ticker.Last) assert.Equal(t, 2075.8257, ticker.Vol) }
explode_data.jsonl/67163
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 367 }
[ 2830, 3393, 1949, 87278, 1155, 353, 8840, 836, 8, 341, 84381, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 25291, 1669, 1532, 11571, 2972, 62100, 340, 25291, 22402, 7285, 1005, 2035, 2099, 2972, 5341, 515, 197, 6246, 2768, 25, 584, 6563...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLoadToken(t *testing.T) { config, err := New(testFilePath) if err != nil { t.Fatalf(err.Error()) } gottenToken, err := config.LoadToken() if err != nil { t.Fatalf(err.Error()) } if gottenToken != expectedToken { t.Errorf("want: %s\nget : %s", expectedToken, gottenToken) } }
explode_data.jsonl/49568
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 119 }
[ 2830, 3393, 5879, 3323, 1155, 353, 8840, 836, 8, 341, 25873, 11, 1848, 1669, 1532, 8623, 19090, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 3964, 6141, 2398, 197, 630, 3174, 10291, 3323, 11, 1848, 1669, 2193, 13969, 3323, 741, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestNew(t *testing.T) { t.Parallel() e := Message{} e.AppendText("whatever", "input", "will\nbe\nchunked") e.AppendData([]byte("amazing")) e.SetRetry(30) e.SetRetry(time.Second) e.SetID(MustEventID("again")) e.SetID(MustEventID("lol")) require.Truef(t, e.SetName("whatever"), "name %q regarded as invalid", "whatever") require.Truef(t, e.SetName("x"), "name %q regarded as invalid", "x") require.Falsef(t, e.SetName("multi\nline"), "name %q regarded as invalid", "multi\nline") now := time.Now() e.SetExpiry(now) expected := Message{ expiresAt: now, chunks: []chunk{ {data: []byte("whatever")}, {data: []byte("input")}, {data: []byte("will\n"), endsInNewline: true}, {data: []byte("be\n"), endsInNewline: true}, {data: []byte("chunked")}, {data: []byte("amazing")}, }, retryValue: []byte("1000\n"), name: []byte("x"), id: []byte("lol"), } require.Equal(t, expected, e, "invalid event") e.SetID(EventID{}) require.Nil(t, e.id, "id was not unset") }
explode_data.jsonl/47326
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 445 }
[ 2830, 3393, 3564, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 7727, 1669, 4856, 16094, 7727, 95713, 445, 68286, 497, 330, 1355, 497, 330, 14387, 1699, 1371, 1699, 25979, 291, 1138, 7727, 8982, 1043, 10556, 3782, 445, 309, 665...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestScrapePoolAppender(t *testing.T) { cfg := &config.ScrapeConfig{} app := &nopAppendable{} sp, _ := newScrapePool(cfg, app, 0, nil) loop := sp.newLoop(scrapeLoopOptions{ target: &Target{}, }) appl, ok := loop.(*scrapeLoop) if !ok { t.Fatalf("Expected scrapeLoop but got %T", loop) } wrapped := appl.appender() tl, ok := wrapped.(*timeLimitAppender) if !ok { t.Fatalf("Expected timeLimitAppender but got %T", wrapped) } if _, ok := tl.Appender.(nopAppender); !ok { t.Fatalf("Expected base appender but got %T", tl.Appender) } loop = sp.newLoop(scrapeLoopOptions{ target: &Target{}, limit: 100, }) appl, ok = loop.(*scrapeLoop) if !ok { t.Fatalf("Expected scrapeLoop but got %T", loop) } wrapped = appl.appender() sl, ok := wrapped.(*limitAppender) if !ok { t.Fatalf("Expected limitAppender but got %T", wrapped) } tl, ok = sl.Appender.(*timeLimitAppender) if !ok { t.Fatalf("Expected limitAppender but got %T", sl.Appender) } if _, ok := tl.Appender.(nopAppender); !ok { t.Fatalf("Expected base appender but got %T", tl.Appender) } }
explode_data.jsonl/56116
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 455 }
[ 2830, 3393, 3326, 19842, 10551, 2164, 1659, 1155, 353, 8840, 836, 8, 341, 50286, 1669, 609, 1676, 18326, 19842, 2648, 16094, 28236, 1669, 609, 62813, 23877, 480, 16094, 41378, 11, 716, 1669, 501, 3326, 19842, 10551, 28272, 11, 906, 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...
8
func TestValidatePodDNSConfig(t *testing.T) { defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.CustomPodDNS, true)() generateTestSearchPathFunc := func(numChars int) string { res := "" for i := 0; i < numChars; i++ { res = res + "a" } return res } testOptionValue := "2" testDNSNone := core.DNSNone testDNSClusterFirst := core.DNSClusterFirst testCases := []struct { desc string dnsConfig *core.PodDNSConfig dnsPolicy *core.DNSPolicy expectedError bool }{ { desc: "valid: empty DNSConfig", dnsConfig: &core.PodDNSConfig{}, expectedError: false, }, { desc: "valid: 1 option", dnsConfig: &core.PodDNSConfig{ Options: []core.PodDNSConfigOption{ {Name: "ndots", Value: &testOptionValue}, }, }, expectedError: false, }, { desc: "valid: 1 nameserver", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"127.0.0.1"}, }, expectedError: false, }, { desc: "valid: DNSNone with 1 nameserver", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"127.0.0.1"}, }, dnsPolicy: &testDNSNone, expectedError: false, }, { desc: "valid: 1 search path", dnsConfig: &core.PodDNSConfig{ Searches: []string{"custom"}, }, expectedError: false, }, { desc: "valid: 3 nameservers and 6 search paths", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"127.0.0.1", "10.0.0.10", "8.8.8.8"}, Searches: []string{"custom", "mydomain.com", "local", "cluster.local", "svc.cluster.local", "default.svc.cluster.local"}, }, expectedError: false, }, { desc: "valid: 256 characters in search path list", dnsConfig: &core.PodDNSConfig{ // We can have 256 - (6 - 1) = 251 characters in total for 6 search paths. Searches: []string{ generateTestSearchPathFunc(1), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), }, }, expectedError: false, }, { desc: "valid: ipv6 nameserver", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"FE80::0202:B3FF:FE1E:8329"}, }, expectedError: false, }, { desc: "invalid: 4 nameservers", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"127.0.0.1", "10.0.0.10", "8.8.8.8", "1.2.3.4"}, }, expectedError: true, }, { desc: "invalid: 7 search paths", dnsConfig: &core.PodDNSConfig{ Searches: []string{"custom", "mydomain.com", "local", "cluster.local", "svc.cluster.local", "default.svc.cluster.local", "exceeded"}, }, expectedError: true, }, { desc: "invalid: 257 characters in search path list", dnsConfig: &core.PodDNSConfig{ // We can have 256 - (6 - 1) = 251 characters in total for 6 search paths. Searches: []string{ generateTestSearchPathFunc(2), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), generateTestSearchPathFunc(50), }, }, expectedError: true, }, { desc: "invalid search path", dnsConfig: &core.PodDNSConfig{ Searches: []string{"custom?"}, }, expectedError: true, }, { desc: "invalid nameserver", dnsConfig: &core.PodDNSConfig{ Nameservers: []string{"invalid"}, }, expectedError: true, }, { desc: "invalid empty option name", dnsConfig: &core.PodDNSConfig{ Options: []core.PodDNSConfigOption{ {Value: &testOptionValue}, }, }, expectedError: true, }, { desc: "invalid: DNSNone with 0 nameserver", dnsConfig: &core.PodDNSConfig{ Searches: []string{"custom"}, }, dnsPolicy: &testDNSNone, expectedError: true, }, } for _, tc := range testCases { if tc.dnsPolicy == nil { tc.dnsPolicy = &testDNSClusterFirst } errs := validatePodDNSConfig(tc.dnsConfig, tc.dnsPolicy, field.NewPath("dnsConfig")) if len(errs) != 0 && !tc.expectedError { t.Errorf("%v: validatePodDNSConfig(%v) = %v, want nil", tc.desc, tc.dnsConfig, errs) } else if len(errs) == 0 && tc.expectedError { t.Errorf("%v: validatePodDNSConfig(%v) = nil, want error", tc.desc, tc.dnsConfig) } } }
explode_data.jsonl/1026
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1928 }
[ 2830, 3393, 17926, 23527, 61088, 2648, 1155, 353, 8840, 836, 8, 341, 16867, 4094, 12753, 8840, 4202, 13859, 42318, 16014, 2271, 1155, 11, 4094, 12753, 13275, 13859, 42318, 11, 4419, 27649, 23527, 61088, 11, 830, 8, 2822, 3174, 13220, 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...
2
func TestSignatureV3Message(t *testing.T) { sig, err := armor.Decode(strings.NewReader(signedMessageV3)) if err != nil { t.Error(err) return } key, err := ReadArmoredKeyRing(strings.NewReader(keyV4forVerifyingSignedMessageV3)) if err != nil { t.Error(err) return } md, err := ReadMessage(sig.Body, key, nil, nil) if err != nil { t.Error(err) return } _, err = ioutil.ReadAll(md.UnverifiedBody) if err != nil { t.Error(err) return } // We'll see a sig error here after reading in the UnverifiedBody above, // if there was one to see. if err = md.SignatureError; err != nil { t.Error(err) return } if md.SignatureV3 == nil { t.Errorf("No available signature after checking signature") return } if md.Signature != nil { t.Errorf("Did not expect a signature V4 back") return } return }
explode_data.jsonl/2294
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 330 }
[ 2830, 3393, 25088, 53, 18, 2052, 1155, 353, 8840, 836, 8, 341, 84841, 11, 1848, 1669, 20033, 56372, 51442, 68587, 1141, 1542, 2052, 53, 18, 1171, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 3964, 340, 197, 853, 198, 197, 532, 23634, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
8
func TestGetBranchesWithHttpError(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { assert.Equal(t, "Basic Q2xpZW50SWQ6Q2xpZW50K1NlY3JldA==", r.Header.Get("Authorization")) w.Header().Set("Content-Type", "application/json") fmt.Fprintln(w, "{\"access_token\" : \"tolen\"}") })) defer ts.Close() branchesServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) })) defer branchesServer.Close() branches, err := new(BranchLoader).LoadBranches(Bitbucket{ ClientID: "ClientId", ClientSecret: "Client Secret", Username: "Username", RepositoryName: "repo", TokenUrl: ts.URL, ApiUrl: branchesServer.URL, }) assert.NoError(t, err) assert.Equal(t, []string{}, branches) }
explode_data.jsonl/50990
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 350 }
[ 2830, 3393, 1949, 18197, 288, 2354, 2905, 1454, 1155, 353, 8840, 836, 8, 1476, 57441, 1669, 54320, 70334, 7121, 5475, 19886, 89164, 18552, 3622, 1758, 37508, 11, 435, 353, 1254, 9659, 8, 341, 197, 6948, 12808, 1155, 11, 330, 15944, 1207...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMedian(t *testing.T) { desc := sdk.Decs{ sdk.NewDec(2), sdk.NewDec(1), } m := sdk.DecMedian(desc) assert.True(t, sdk.NewDec(3).Quo(sdk.NewDec(2)).Equal(m)) desc = sdk.Decs{ sdk.NewDec(2), sdk.NewDec(3), sdk.NewDec(1), } m = sdk.DecMedian(desc) assert.True(t, sdk.NewDec(2).Equal(m)) desc = sdk.Decs{ sdk.NewDec(3), } m = sdk.DecMedian(desc) assert.True(t, sdk.NewDec(3).Equal(m)) desc = sdk.Decs{ sdk.NewDec(1), sdk.NewDec(1), sdk.NewDec(1), sdk.NewDec(1), sdk.NewDec(5), sdk.NewDec(6), } m = sdk.DecMedian(desc) assert.True(t, sdk.NewDec(1).Equal(m)) }
explode_data.jsonl/54446
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 345 }
[ 2830, 3393, 79514, 1155, 353, 8840, 836, 8, 341, 41653, 1669, 45402, 22442, 82, 515, 197, 1903, 7584, 7121, 4900, 7, 17, 1326, 197, 1903, 7584, 7121, 4900, 7, 16, 1326, 197, 532, 2109, 1669, 45402, 22442, 79514, 37673, 340, 6948, 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 TestTransactionCapClearsFromAll(t *testing.T) { t.Parallel() // Create the pool to test the limit enforcement with statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()), nil) blockchain := &testBlockChain{statedb, 1000000, new(notify.Feed)} config := testTxPoolConfig config.AccountSlots = 2 config.AccountQueue = 2 config.GlobalSlots = 8 pool := NewTxPool(config, params.TestChainConfig, blockchain) defer pool.Stop() // Create a number of test accounts and fund them key, _ := crypto.GenerateKey() addr := crypto.PubkeyToAddress(key.PublicKey) pool.currentState.AddBalance(addr, big.NewInt(1000000)) txs := types.Transactions{} for j := 0; j < int(config.GlobalSlots)*2; j++ { txs = append(txs, transaction(uint64(j), 100000, key)) } // Import the batch and verify that limits have been enforced pool.AddRemotes(txs) if err := validateTxPoolInternals(pool); err != nil { t.Fatalf("pool internal state corrupted: %v", err) } }
explode_data.jsonl/7874
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 332 }
[ 2830, 3393, 8070, 12903, 14008, 82, 3830, 2403, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 197, 322, 4230, 279, 7314, 311, 1273, 279, 3930, 13324, 448, 198, 18388, 657, 65, 11, 716, 1669, 1584, 7121, 57802, 15103, 22655, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestHeadBroadcaster_BroadcastNewLongestChain(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) lggr := logger.TestLogger(t) broadcaster := headtracker.NewHeadBroadcaster(lggr) err := broadcaster.Start() require.NoError(t, err) // no subscribers - shall do nothing broadcaster.BroadcastNewLongestChain(cltest.Head(0)) subscriber1 := &cltest.MockHeadTrackable{} subscriber2 := &cltest.MockHeadTrackable{} _, unsubscribe1 := broadcaster.Subscribe(subscriber1) _, unsubscribe2 := broadcaster.Subscribe(subscriber2) broadcaster.BroadcastNewLongestChain(cltest.Head(1)) g.Eventually(func() int32 { return subscriber1.OnNewLongestChainCount() }).Should(gomega.Equal(int32(1))) unsubscribe1() broadcaster.BroadcastNewLongestChain(cltest.Head(2)) g.Eventually(func() int32 { return subscriber2.OnNewLongestChainCount() }).Should(gomega.Equal(int32(2))) unsubscribe2() subscriber3 := &cltest.MockHeadTrackable{} _, unsubscribe3 := broadcaster.Subscribe(subscriber3) broadcaster.BroadcastNewLongestChain(cltest.Head(1)) g.Eventually(func() int32 { return subscriber3.OnNewLongestChainCount() }).Should(gomega.Equal(int32(1))) unsubscribe3() err = broadcaster.Close() require.NoError(t, err) }
explode_data.jsonl/19967
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 438 }
[ 2830, 3393, 12346, 68324, 32020, 1668, 19105, 3564, 6583, 477, 18837, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 3174, 1669, 342, 32696, 7121, 2354, 51, 1155, 692, 8810, 70, 901, 1669, 5925, 8787, 7395, 1155, 340, 2233, 8546,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUnpackBindingLastOperationRequest(t *testing.T) { args := map[string]string{ "instance_id": "i1234", "service_id": "s1234", "binding_id": "b1234", "plan_id": "p1234", "operation": "o1234", } req := createFakeBindingLastOperationRequest(args) req.Header.Set("X-Broker-API-Originating-Identity", "kubernetes ZHVkZXI=") bindingLastOpReq, err := unpackBindingLastOperationRequest(req, args) if err != nil { t.Fatalf("Unpacking binding last operation request: %v", err) } if bindingLastOpReq.InstanceID != args["instance_id"] { t.Fatalf("InstanceID was unpacked unsuccessfully. Expecting %s got %s", args["instance_id"], bindingLastOpReq.InstanceID) } if *bindingLastOpReq.ServiceID != args["service_id"] { t.Fatalf("ServiceID was unpacked unsuccessfully. Expecting %s got %s", args["service_id"], *bindingLastOpReq.ServiceID) } if *bindingLastOpReq.PlanID != args["plan_id"] { t.Fatalf("PlanID was unpacked unsuccessfully. Expecting %s got %s", args["plan_id"], *bindingLastOpReq.PlanID) } if string(*bindingLastOpReq.OperationKey) != args["operation"] { t.Fatalf("OperationKey was unpacked unsuccessfully. Expecting %s got %s", args["operation"], *bindingLastOpReq.OperationKey) } }
explode_data.jsonl/79740
{ "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, 1806, 4748, 15059, 5842, 8432, 1900, 1155, 353, 8840, 836, 8, 341, 31215, 1669, 2415, 14032, 30953, 515, 197, 197, 1, 4851, 842, 788, 330, 72, 16, 17, 18, 19, 756, 197, 197, 1, 7936, 842, 788, 220, 330, 82, 16, 17, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestPatchUpdateFactNoModification(t *testing.T) { json, err := json.Marshal(testFact) if err != nil { assert.Failf(t, "unable to marshal test instance: %s", err.Error()) } get := func(*http.Request) (*http.Response, error) { return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil } patch := func(*http.Request) (*http.Response, error) { return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil } fakeClient := newClientForTest(get, patch) facts := facts{ client: fakeClient, ns: "default", } updated, err := facts.PatchUpdate(testFact) assert.NoError(t, err) assert.Equal(t, testFact, updated) }
explode_data.jsonl/45997
{ "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, 43622, 4289, 17417, 2753, 80795, 1155, 353, 8840, 836, 8, 341, 30847, 11, 1848, 1669, 2951, 37271, 8623, 17417, 340, 743, 1848, 961, 2092, 341, 197, 6948, 57243, 69, 1155, 11, 330, 45928, 311, 60771, 1273, 2867, 25, 1018, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestExtractDeclarationDoesNotConform(t *testing.T) { value := gidlir.Record{ Name: "ExampleStruct", Fields: []gidlir.Field{ {Key: gidlir.FieldKey{Name: "ThisIsNotAField"}, Value: "foo"}, }, } decl, err := testSchema(t).ExtractDeclaration(value, nil) if err == nil { t.Fatalf("ExtractDeclaration unexpectedly succeeded: %#v", decl) } if !strings.Contains(err.Error(), "conform") { t.Fatalf("expected err to contain 'conform', got '%s'", err) } }
explode_data.jsonl/21390
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 187 }
[ 2830, 3393, 28959, 24489, 21468, 2623, 1109, 627, 1155, 353, 8840, 836, 8, 341, 16309, 1669, 45863, 75, 404, 49959, 515, 197, 21297, 25, 330, 13314, 9422, 756, 197, 197, 8941, 25, 3056, 34849, 75, 404, 17087, 515, 298, 197, 90, 1592, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestArrayStack(t *testing.T) { s := new(ArrayStack) s.Init(4) testArrayStackPush(t, s, 0) testArrayStackGetTop(t, s, 0) testArrayStackPop(t, s, 0) }
explode_data.jsonl/46596
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 72 }
[ 2830, 3393, 1857, 4336, 1155, 353, 8840, 836, 8, 341, 1903, 1669, 501, 38192, 4336, 340, 1903, 26849, 7, 19, 340, 18185, 1857, 4336, 16644, 1155, 11, 274, 11, 220, 15, 340, 18185, 1857, 4336, 1949, 5366, 1155, 11, 274, 11, 220, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestStoreImmutableConfig(t *testing.T) { store := NewStore(logtesting.TestLogger(t)) store.OnConfigChanged(ConfigMapFromTestFile(t, DefaultsConfigName)) config := store.Load() config.Defaults.RevisionTimeoutSeconds = 1234 newConfig := store.Load() if newConfig.Defaults.RevisionTimeoutSeconds == 1234 { t.Error("Defaults config is not immutable") } }
explode_data.jsonl/45715
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 120 }
[ 2830, 3393, 6093, 58890, 2648, 1155, 353, 8840, 836, 8, 341, 57279, 1669, 1532, 6093, 12531, 8840, 8787, 7395, 1155, 4390, 57279, 8071, 2648, 5389, 33687, 2227, 3830, 2271, 1703, 1155, 11, 35990, 2648, 675, 4390, 25873, 1669, 3553, 13969,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCommandsTooManyArguments(t *testing.T) { commands := []commandWithFunction{ {"ENV", func(args []string) error { return env(nil, args, nil, "") }}, {"LABEL", func(args []string) error { return label(nil, args, nil, "") }}} for _, command := range commands { err := command.function([]string{"arg1", "arg2", "arg3"}) if err == nil { t.Fatalf("Error should be present for %s command", command.name) } expectedError := errTooManyArguments(command.name) if err.Error() != expectedError.Error() { t.Fatalf("Wrong error message for %s. Got: %s. Should be: %s", command.name, err.Error(), expectedError) } } }
explode_data.jsonl/28271
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 229 }
[ 2830, 3393, 30479, 31246, 8441, 19139, 1155, 353, 8840, 836, 8, 341, 197, 24270, 1669, 3056, 5631, 2354, 5152, 515, 197, 197, 4913, 30360, 497, 2915, 7356, 3056, 917, 8, 1465, 314, 470, 6105, 27907, 11, 2827, 11, 2092, 11, 11700, 6439...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFirstStatementFail(t *testing.T) { store, clean := createMockStoreAndSetup(t) defer clean() tk := testkit.NewTestKit(t, store) tk.MustExec("use test") tk.MustExec("drop table if exists first") tk.MustExec("create table first (k int unique)") tk.MustExec("insert first values (1)") tk.MustExec("begin pessimistic") _, err := tk.Exec("insert first values (1)") require.Error(t, err) tk.MustExec("insert first values (2)") tk.MustExec("commit") }
explode_data.jsonl/12454
{ "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, 5338, 8636, 19524, 1155, 353, 8840, 836, 8, 341, 57279, 11, 4240, 1669, 1855, 11571, 6093, 3036, 21821, 1155, 340, 16867, 4240, 2822, 3244, 74, 1669, 1273, 8226, 7121, 2271, 7695, 1155, 11, 3553, 340, 3244, 74, 50463, 10216,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestHybiServerReadWithoutMasking(t *testing.T) { wireData := []byte{0x81, 0x05, 'h', 'e', 'l', 'l', 'o'} br := bufio.NewReader(bytes.NewBuffer(wireData)) bw := bufio.NewWriter(bytes.NewBuffer([]byte{})) conn := newHybiConn(newConfig(t, "/"), bufio.NewReadWriter(br, bw), nil, new(http.Request)) // server MUST close the connection upon receiving a non-masked frame. msg := make([]byte, 512) _, err := conn.Read(msg) if err != io.EOF { t.Errorf("read 1st frame, expect %q, but got %q", io.EOF, err) } }
explode_data.jsonl/53448
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 208 }
[ 2830, 3393, 30816, 8221, 5475, 4418, 26040, 12686, 287, 1155, 353, 8840, 836, 8, 341, 6692, 554, 1043, 1669, 3056, 3782, 90, 15, 87, 23, 16, 11, 220, 15, 87, 15, 20, 11, 364, 71, 516, 364, 68, 516, 364, 75, 516, 364, 75, 516, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFocusBlur(t *testing.T) { t.Parallel() ctx, cancel := testAllocate(t, "js.html") defer cancel() tests := []struct { sel string by QueryOption }{ {`//*[@id="input1"]`, BySearch}, {`body > input[type="number"]:nth-child(1)`, ByQueryAll}, {`body > input[type="number"]:nth-child(1)`, ByQuery}, {`#input1`, ByID}, {`document.querySelector("#input1")`, ByJSPath}, } if err := Run(ctx, Click("#input1", ByID)); err != nil { t.Fatal(err) } for i, test := range tests { var value string if err := Run(ctx, Focus(test.sel, test.by), Value(test.sel, &value, test.by), ); err != nil { t.Fatalf("test %d got error: %v", i, err) } if value != "9999" { t.Errorf("test %d expected value is '9999', got: %q", i, value) } if err := Run(ctx, Blur(test.sel, test.by), Value(test.sel, &value, test.by), ); err != nil { t.Fatalf("test %d got error: %v", i, err) } if value != "0" { t.Errorf("test %d expected value is '0', got: %q", i, value) } } }
explode_data.jsonl/59466
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 459 }
[ 2830, 3393, 13819, 31498, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 20985, 11, 9121, 1669, 1273, 75380, 1155, 11, 330, 2519, 2564, 1138, 16867, 9121, 2822, 78216, 1669, 3056, 1235, 341, 197, 1903, 301, 914, 198, 197, 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...
7
func TestLogsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) rCfg := NewDefaultRetrySettings() qCfg := NewDefaultQueueSettings() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") te, err := NewLogsExporter(&fakeLogsExporterConfig, tt.ToExporterCreateSettings(), newPushLogsData(wantErr), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NotNil(t, te) md := testdata.GenerateLogsTwoLogRecordsSameResourceOneDifferent() const numBatches = 7 for i := 0; i < numBatches; i++ { // errors are checked in the checkExporterEnqueueFailedLogsStats function below. _ = te.ConsumeLogs(context.Background(), md) } // 2 batched must be in queue, and 5 batches (15 log records) rejected due to queue overflow checkExporterEnqueueFailedLogsStats(t, globalInstruments, fakeLogsExporterName, int64(15)) }
explode_data.jsonl/59609
{ "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, 51053, 88025, 62, 2354, 6471, 1702, 4584, 9408, 27328, 1155, 353, 8840, 836, 8, 341, 3244, 83, 11, 1848, 1669, 7448, 11736, 1944, 39820, 6639, 35958, 741, 17957, 35699, 1155, 11, 1848, 340, 3244, 727, 60639, 18552, 368, 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 TestEqualSplitsAlgorithm(t *testing.T) { // singleTest is a function that executes a single-test. singleTest := func(testCase *equalSplitsAlgorithmTestCaseType) { splitParams, err := NewSplitParamsGivenSplitCount( "select * from test_table where int_col > 5", /* bindVariables */ nil, []sqlparser.ColIdent{sqlparser.NewColIdent(testCase.SplitColumn)}, testCase.SplitCount, getTestSchema(), ) if err != nil { t.Errorf("NewSplitParamsWithNumRowsPerQueryPart failed with: %v", err) return } mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() mockSQLExecuter := splitquery_testing.NewMockSQLExecuter(mockCtrl) expectedCall1 := mockSQLExecuter.EXPECT().SQLExecute( fmt.Sprintf( "select min(%v), max(%v) from test_table", testCase.SplitColumn, testCase.SplitColumn), nil /* Bind Variables */) expectedCall1.Return( &sqltypes.Result{ Rows: [][]sqltypes.Value{ {testCase.MinValue, testCase.MaxValue}, }, }, nil) algorithm, err := NewEqualSplitsAlgorithm(splitParams, mockSQLExecuter) if err != nil { t.Errorf("NewEqualSplitsAlgorithm() failed with: %v", err) return } boundaries, err := algorithm.generateBoundaries() if err != nil { t.Errorf("EqualSplitsAlgorithm.generateBoundaries() failed with: %v", err) return } if !reflect.DeepEqual(boundaries, testCase.ExpectedBoundaries) { t.Errorf("EqualSplitsAlgorith.generateBoundaries()=%+v, expected: %+v. testCase: %+v", boundaries, testCase.ExpectedBoundaries, testCase) } } // singleTest() for _, testCase := range equalSplitsAlgorithmTestCases { singleTest(&testCase) } }
explode_data.jsonl/62150
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 658 }
[ 2830, 3393, 2993, 50, 39033, 27847, 1155, 353, 8840, 836, 8, 341, 197, 322, 3175, 2271, 374, 264, 729, 429, 51435, 264, 3175, 16839, 624, 1903, 2173, 2271, 1669, 2915, 8623, 4207, 353, 25795, 50, 39033, 27847, 16458, 929, 8, 341, 197,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestInTrans(t *testing.T) { store, clean := realtikvtest.CreateMockStoreAndSetup(t) defer clean() tk := testkit.NewTestKit(t, store) tk.MustExec("use test") tk.MustExec("drop table if exists t;") tk.MustExec("create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)") tk.MustExec("insert t values ()") tk.MustExec("begin") txn, err := tk.Session().Txn(true) require.NoError(t, err) require.True(t, txn.Valid()) tk.MustExec("insert t values ()") require.True(t, txn.Valid()) tk.MustExec("drop table if exists t;") require.False(t, txn.Valid()) tk.MustExec("create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)") require.False(t, txn.Valid()) tk.MustExec("insert t values ()") require.False(t, txn.Valid()) tk.MustExec("commit") tk.MustExec("insert t values ()") tk.MustExec("set autocommit=0") tk.MustExec("begin") require.True(t, txn.Valid()) tk.MustExec("insert t values ()") require.True(t, txn.Valid()) tk.MustExec("commit") require.False(t, txn.Valid()) tk.MustExec("insert t values ()") require.True(t, txn.Valid()) tk.MustExec("commit") require.False(t, txn.Valid()) tk.MustExec("set autocommit=1") tk.MustExec("drop table if exists t") tk.MustExec("create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)") tk.MustExec("begin") require.True(t, txn.Valid()) tk.MustExec("insert t values ()") require.True(t, txn.Valid()) tk.MustExec("rollback") require.False(t, txn.Valid()) }
explode_data.jsonl/5809
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 566 }
[ 2830, 3393, 641, 3167, 1155, 353, 8840, 836, 8, 341, 57279, 11, 4240, 1669, 1931, 83, 1579, 85, 1944, 7251, 11571, 6093, 3036, 21821, 1155, 340, 16867, 4240, 2822, 3244, 74, 1669, 1273, 8226, 7121, 2271, 7695, 1155, 11, 3553, 340, 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...
1
func TestIDF0(t *testing.T) { df := NewDocumentFrequency() vocab := map[string]int{} df.AddVocabulary(vocab) _, ok := df.IDF("") okExpected := false if ok != okExpected { t.Error("index.TestIDF0: okExpected ", okExpected, " got ", ok) } n := df.N nExpected := 1 if n != nExpected { t.Error("index.TestIDF0: nExpected ", nExpected, " got ", n) } }
explode_data.jsonl/9828
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 159 }
[ 2830, 3393, 915, 37, 15, 1155, 353, 8840, 836, 8, 341, 85187, 1669, 1532, 7524, 38614, 741, 5195, 20497, 1669, 2415, 14032, 63025, 16094, 85187, 1904, 53, 43527, 3747, 20497, 340, 197, 6878, 5394, 1669, 6764, 9910, 37, 31764, 59268, 188...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSubmitOrder(t *testing.T) { p.SetDefaults() TestSetup(t) if areTestAPIKeysSet() && !canManipulateRealOrders { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } var pair = currency.Pair{ Delimiter: "_", Base: currency.BTC, Quote: currency.LTC, } response, err := p.SubmitOrder(pair, exchange.BuyOrderSide, exchange.MarketOrderType, 1, 10, "hi") if areTestAPIKeysSet() && (err != nil || !response.IsOrderPlaced) { t.Errorf("Order failed to be placed: %v", err) } else if !areTestAPIKeysSet() && err == nil { t.Error("Expecting an error when no keys are set") } }
explode_data.jsonl/23571
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 253 }
[ 2830, 3393, 8890, 4431, 1155, 353, 8840, 836, 8, 341, 3223, 4202, 16273, 741, 73866, 21821, 1155, 692, 743, 525, 2271, 7082, 8850, 1649, 368, 1009, 753, 4814, 92876, 6334, 12768, 24898, 341, 197, 3244, 57776, 445, 7082, 6894, 738, 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...
8
func TestNewClient_ViaEnv(t *testing.T) { testcases := []struct { name string env map[string]string expectedUrl string hasError bool }{ { name: "default", expectedUrl: "http://localhost:3370", }, { name: "just-domain-name", env: map[string]string{"LS_CONTROLLERS": "just.domain"}, expectedUrl: "http://just.domain:3370", }, { name: "linstor-protocol", env: map[string]string{"LS_CONTROLLERS": "linstor://just.domain"}, expectedUrl: "http://just.domain:3370", }, { name: "just-domain-with-port", env: map[string]string{"LS_CONTROLLERS": "just.domain:4000"}, expectedUrl: "http://just.domain:4000", }, { name: "domain-with-protocol", env: map[string]string{"LS_CONTROLLERS": "http://just.domain"}, expectedUrl: "http://just.domain:3370", }, { name: "just-domain-with-https-protocol", env: map[string]string{"LS_CONTROLLERS": "https://just.domain"}, expectedUrl: "https://just.domain:3371", }, { name: "just-domain-with-client-secrets", env: map[string]string{"LS_CONTROLLERS": "just.domain", "LS_ROOT_CA": TestCaCert}, expectedUrl: "https://just.domain:3371", }, { name: "just-domain-with-client-secrets-and-port", env: map[string]string{"LS_CONTROLLERS": "just.domain:4000", "LS_ROOT_CA": TestCaCert}, expectedUrl: "https://just.domain:4000", }, { name: "parse-error-multi-scheme", env: map[string]string{"LS_CONTROLLERS": "https://http://just.domain:4000"}, hasError: true, }, { name: "parse-error-multi-port", env: map[string]string{"LS_CONTROLLERS": "https://just.domain:4000:5000"}, hasError: true, }, { name: "parse-error-inconsistent-env", env: map[string]string{"LS_CONTROLLERS": "https://just.domain:4000", "LS_USER_CERTIFICATE": "stuff"}, hasError: true, }, { name: "parse-error-inconsistent-env-other", env: map[string]string{"LS_CONTROLLERS": "https://just.domain:4000", "LS_USER_KEY": "stuff"}, hasError: true, }, } for _, item := range testcases { test := item t.Run(test.name, func(t *testing.T) { os.Clearenv() for k, v := range test.env { _ = os.Setenv(k, v) } actual, err := NewClient() if actual == nil { if !test.hasError { t.Errorf("expected no error, got error: %v", err) } return } if test.expectedUrl != actual.baseURL.String() { t.Errorf("expected url: %v, got url: %v", test.expectedUrl, actual.baseURL.String()) } }) } }
explode_data.jsonl/46897
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1120 }
[ 2830, 3393, 3564, 2959, 2334, 685, 14359, 1155, 353, 8840, 836, 8, 341, 18185, 23910, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 57538, 260, 2415, 14032, 30953, 198, 197, 42400, 2864, 914, 198, 197, 63255, 1454, 262, 1807, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestBindingRequestTimeout(t *testing.T) { report := test.CheckRoutines(t) defer report() const expectedRemovalCount = 2 a, err := NewAgent(&AgentConfig{}) assert.NoError(t, err) now := time.Now() a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{ timestamp: now, }) a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{ timestamp: now.Add(-25 * time.Millisecond), }) a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{ timestamp: now.Add(-750 * time.Millisecond), }) a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{ timestamp: now.Add(-75 * time.Hour), }) a.invalidatePendingBindingRequests(now) assert.Equal(t, len(a.pendingBindingRequests), expectedRemovalCount, "Binding invalidation due to timeout did not remove the correct number of binding requests") assert.NoError(t, a.Close()) }
explode_data.jsonl/50574
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 320 }
[ 2830, 3393, 15059, 1900, 7636, 1155, 353, 8840, 836, 8, 341, 69931, 1669, 1273, 10600, 49, 28628, 1155, 340, 16867, 1895, 2822, 4777, 3601, 6590, 13516, 2507, 284, 220, 17, 271, 11323, 11, 1848, 1669, 1532, 16810, 2099, 16810, 2648, 377...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestStartSampling(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) m := NewMonitorWithInterval(5 * time.Millisecond) doneCh := make(chan struct{}) var count int m.AddSampler(NewSampler(m, 21*time.Millisecond, func(previous bool) (condition *monitorapi.Condition, next bool) { defer func() { count++ }() switch { case count <= 5: return nil, true case count == 6: return &monitorapi.Condition{Level: monitorapi.Error, Locator: "tester", Message: "dying"}, false case count == 7: return &monitorapi.Condition{Level: monitorapi.Info, Locator: "tester", Message: "recovering"}, true case count <= 12: return nil, true case count == 13: return &monitorapi.Condition{Level: monitorapi.Error, Locator: "tester", Message: "dying 2"}, false case count <= 16: return nil, false case count == 17: return &monitorapi.Condition{Level: monitorapi.Info, Locator: "tester", Message: "recovering 2"}, true case count <= 20: return nil, true default: doneCh <- struct{}{} return nil, true } }).ConditionWhenFailing(ctx, &monitorapi.Condition{ Level: monitorapi.Error, Locator: "tester", Message: "down", })) m.StartSampling(ctx) <-doneCh cancel() var describe []string var log []string events := m.Intervals(time.Time{}, time.Time{}) for _, interval := range events { i := interval.To.Sub(interval.From) describe = append(describe, fmt.Sprintf("%v %s", interval.Condition, i)) log = append(log, fmt.Sprintf("%v", interval.Condition)) } expected := []string{ fmt.Sprintf("{Error tester dying}"), fmt.Sprintf("{Error tester down}"), fmt.Sprintf("{Info tester recovering}"), fmt.Sprintf("{Error tester dying 2}"), fmt.Sprintf("{Error tester down}"), fmt.Sprintf("{Info tester recovering 2}"), } if !reflect.DeepEqual(log, expected) { t.Fatalf("%s", diff.ObjectReflectDiff(log, expected)) } if events[4].To.Sub(events[4].From) < 2*events[1].To.Sub(events[1].From) { t.Fatalf("last condition should be at least 2x first condition length:\n%s", strings.Join(describe, "\n")) } else { t.Logf("%s", strings.Join(describe, "\n")) } }
explode_data.jsonl/76471
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 804 }
[ 2830, 3393, 3479, 98622, 1155, 353, 8840, 836, 8, 341, 20985, 11, 9121, 1669, 2266, 26124, 9269, 5378, 19047, 2398, 2109, 1669, 1532, 30098, 2354, 10256, 7, 20, 353, 882, 71482, 692, 40495, 1143, 1669, 1281, 35190, 2036, 37790, 2405, 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 TestMemoryGenesis(t *testing.T) { tf.UnitTest(t) t.Run("SetupTeardown", func(t *testing.T) { ctx := context.Background() testDir, err := ioutil.TempDir(".", "environmentTest") require.NoError(t, err) defer func() { require.NoError(t, os.RemoveAll(testDir)) }() env, err := NewMemoryGenesis(big.NewInt(100000), testDir) localenv := env.(*MemoryGenesis) assert.NoError(t, err) assert.NotNil(t, env) assert.Equal(t, testDir, localenv.location) // did we create the dir correctly? _, err = os.Stat(localenv.location) assert.NoError(t, err) // did we teardown correctly? assert.NoError(t, env.Teardown(ctx)) assert.Equal(t, 0, len(env.Processes())) _, existsErr := os.Stat(localenv.location) assert.True(t, os.IsNotExist(existsErr)) }) t.Run("ProcessCreateAndTeardown", func(t *testing.T) { ctx := context.Background() testDir, err := ioutil.TempDir(".", "environmentTest") require.NoError(t, err) defer func() { require.NoError(t, os.RemoveAll(testDir)) }() env, err := NewMemoryGenesis(big.NewInt(100000), testDir) require.NoError(t, err) p, err := env.NewProcess(ctx, mockplugin.PluginName, nil, fast.FilecoinOpts{}) assert.NoError(t, err) assert.NotNil(t, p) assert.Equal(t, 1, len(env.Processes())) // did we create the process dir correctly? _, err = os.Stat(p.Dir()) assert.NoError(t, err) assert.NoError(t, env.TeardownProcess(ctx, p)) assert.Equal(t, 0, len(env.Processes())) // did we teardown the process correctly? _, existsErr := os.Stat(p.Dir()) assert.True(t, os.IsNotExist(existsErr)) }) }
explode_data.jsonl/29202
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 665 }
[ 2830, 3393, 10642, 84652, 1155, 353, 8840, 836, 8, 341, 3244, 69, 25159, 2271, 1155, 692, 3244, 16708, 445, 21821, 6639, 37496, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 20985, 1669, 2266, 19047, 2822, 197, 18185, 6184, 11, 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 TestRewards(t *testing.T) { p := NewPersist() ctx := context.Background() tm := time.Now().UTC().Truncate(1 * time.Second) v := &Rewards{} v.ID = "id1" v.BlockID = "bid1" v.Txid = "txid1" v.Shouldprefercommit = true v.CreatedAt = tm stream := health.NewStream() rawDBConn, err := dbr.Open(TestDB, TestDSN, stream) if err != nil { t.Fatal("db fail", err) } _, _ = rawDBConn.NewSession(stream).DeleteFrom(TableRewards).Exec() err = p.InsertRewards(ctx, rawDBConn.NewSession(stream), v, true) if err != nil { t.Fatal("insert fail", err) } fv, err := p.QueryRewards(ctx, rawDBConn.NewSession(stream), v) if err != nil { t.Fatal("query fail", err) } if !reflect.DeepEqual(*v, *fv) { t.Fatal("compare fail") } v.BlockID = "bid2" v.Txid = "txid2" v.Shouldprefercommit = false v.CreatedAt = tm err = p.InsertRewards(ctx, rawDBConn.NewSession(stream), v, true) if err != nil { t.Fatal("insert fail", err) } fv, err = p.QueryRewards(ctx, rawDBConn.NewSession(stream), v) if err != nil { t.Fatal("query fail", err) } if v.Txid != "txid2" { t.Fatal("compare fail") } if !reflect.DeepEqual(*v, *fv) { t.Fatal("compare fail") } }
explode_data.jsonl/12935
{ "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, 58465, 2347, 1155, 353, 8840, 836, 8, 341, 3223, 1669, 1532, 61267, 741, 20985, 1669, 2266, 19047, 741, 3244, 76, 1669, 882, 13244, 1005, 21183, 1005, 1282, 26900, 7, 16, 353, 882, 32435, 692, 5195, 1669, 609, 58465, 2347, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
func TestUser(t *testing.T) { api, config, instanceID, err := setupAPIForTestForInstance() require.NoError(t, err) ts := &UserTestSuite{ API: api, Config: config, instanceID: instanceID, } defer api.db.Close() suite.Run(t, ts) }
explode_data.jsonl/10357
{ "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, 1474, 1155, 353, 8840, 836, 8, 341, 54299, 11, 2193, 11, 2867, 915, 11, 1848, 1669, 6505, 7082, 2461, 2271, 2461, 2523, 741, 17957, 35699, 1155, 11, 1848, 692, 57441, 1669, 609, 1474, 2271, 28000, 515, 197, 197, 7082, 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...
1
func TestSendEphemeralText(t *testing.T) { response, err := SendEphemeralText("my message") assert.Nil(t, err) assert.Equal(t, model.COMMAND_RESPONSE_TYPE_EPHEMERAL, response.Type) assert.Equal(t, "my message", response.Text) }
explode_data.jsonl/43862
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 93 }
[ 2830, 3393, 11505, 36, 59941, 3253, 1178, 1155, 353, 8840, 836, 8, 341, 21735, 11, 1848, 1669, 11000, 36, 59941, 3253, 1178, 445, 2408, 1943, 1138, 1572, 6948, 59678, 1155, 11, 1848, 340, 6948, 12808, 1155, 11, 1614, 20851, 24958, 35901...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUpdateNSSwitchConfig(t *testing.T) { oslogin := " cache_oslogin oslogin" var tests = []struct { contents, want []string enable bool }{ { contents: []string{ "line1", "passwd: line2", "group: line3", }, want: []string{ "line1", "passwd: line2" + oslogin, "group: line3" + oslogin, }, enable: true, }, { contents: []string{ "line1", "passwd: line2" + oslogin, "group: line3" + oslogin, }, want: []string{ "line1", "passwd: line2", "group: line3", }, enable: false, }, { contents: []string{ "line1", "passwd: line2" + oslogin, "group: line3" + oslogin, }, want: []string{ "line1", "passwd: line2" + oslogin, "group: line3" + oslogin, }, enable: true, }, } for idx, tt := range tests { contents := strings.Join(tt.contents, "\n") want := strings.Join(tt.want, "\n") if res := updateNSSwitchConfig(contents, tt.enable); res != want { t.Errorf("test %v\nwant:\n%v\ngot:\n%v\n", idx, want, res) } } }
explode_data.jsonl/7387
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 538 }
[ 2830, 3393, 4289, 53302, 5539, 2648, 1155, 353, 8840, 836, 8, 341, 25078, 3673, 1669, 330, 6500, 29387, 3673, 2643, 3673, 1837, 2405, 7032, 284, 3056, 1235, 341, 197, 197, 17610, 11, 1366, 3056, 917, 198, 197, 197, 12552, 260, 1807, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestInterface(t *testing.T) { //u := &UserService{} //var i interface{} = u //o, ok := i.(CURD) // 类型断言,判断实例u是否实现了接口CURD //if ok { // fmt.Println(o, ok) //} else { // fmt.Println("ss") //} //r := gin.Default() //r.GET("/get", GetUserScoreHandler(u)) //r.Run() }
explode_data.jsonl/32780
{ "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, 5051, 1155, 353, 8840, 836, 8, 1476, 197, 322, 84, 1669, 609, 60004, 16094, 197, 322, 947, 600, 3749, 6257, 284, 575, 198, 197, 322, 78, 11, 5394, 1669, 600, 12832, 38791, 35, 8, 442, 69674, 24300, 63789, 77144, 3837, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRollbackManager_Join(t *testing.T) { m, backend := mockRollback(t) if len(backend.Paths) > 0 { t.Fatalf("bad: %#v", backend) } m.Start() defer m.Stop() wg := &sync.WaitGroup{} wg.Add(3) go func() { defer wg.Done() err := m.Rollback("foo") if err != nil { t.Fatalf("err: %v", err) } }() go func() { defer wg.Done() err := m.Rollback("foo") if err != nil { t.Fatalf("err: %v", err) } }() go func() { defer wg.Done() err := m.Rollback("foo") if err != nil { t.Fatalf("err: %v", err) } }() wg.Wait() }
explode_data.jsonl/53865
{ "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, 32355, 1419, 2043, 10598, 1961, 1155, 353, 8840, 836, 8, 341, 2109, 11, 19163, 1669, 7860, 32355, 1419, 1155, 340, 743, 2422, 7, 20942, 91663, 8, 861, 220, 15, 341, 197, 3244, 30762, 445, 13855, 25, 52406, 85, 497, 19163, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSVGAttributeOptions(t *testing.T) { tcs := []struct { name string fn func(*testing.T) }{ {"should add the passed attribute to the svg tag", withAttributeOption}, {"should add the passed attributes to the svg tag", withAttributesOption}, {"latest attribute wins", withAttributeMultipleTimesOption}, {"no attributes are lost", withAttributesNothingIsLostOption}, } for _, tc := range tcs { t.Run(tc.name, tc.fn) } }
explode_data.jsonl/77428
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 144 }
[ 2830, 3393, 64397, 3907, 3798, 1155, 353, 8840, 836, 8, 341, 3244, 4837, 1669, 3056, 1235, 341, 197, 11609, 914, 198, 197, 40095, 256, 2915, 4071, 8840, 836, 340, 197, 59403, 197, 197, 4913, 5445, 912, 279, 5823, 7035, 311, 279, 26852...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServer_Request_Post_Body_OneData(t *testing.T) { const content = "Some content" testBodyContents(t, -1, content, func(st *serverTester) { st.writeHeaders(HeadersFrameParam{ StreamID: 1, // clients send odd numbers BlockFragment: st.encodeHeader(":method", "POST"), EndStream: false, // to say DATA frames are coming EndHeaders: true, }) st.writeData(1, true, []byte(content)) }) }
explode_data.jsonl/71609
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 163 }
[ 2830, 3393, 5475, 44024, 66726, 1668, 1076, 68201, 1043, 1155, 353, 8840, 836, 8, 341, 4777, 2213, 284, 330, 8373, 2213, 698, 18185, 5444, 14803, 1155, 11, 481, 16, 11, 2213, 11, 2915, 5895, 353, 4030, 58699, 8, 341, 197, 18388, 3836,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMultilingualDisableDefaultLanguage(t *testing.T) { t.Parallel() assert := require.New(t) cfg, _ := newTestBundleSourcesMultilingual(t) cfg.Set("disableLanguages", []string{"en"}) err := loadDefaultSettingsFor(cfg) assert.Error(err) assert.Contains(err.Error(), "cannot disable default language") }
explode_data.jsonl/82016
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 103 }
[ 2830, 3393, 40404, 49823, 25479, 3675, 13806, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 6948, 1669, 1373, 7121, 1155, 340, 50286, 11, 716, 1669, 501, 2271, 8409, 32200, 40404, 49823, 1155, 692, 50286, 4202, 445, 18015, 59286,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMergePatterns(t *testing.T) { cases := []struct { input string want string }{ { input: "foo()bar", want: `{"start":{"line":0,"column":0},"end":{"line":0,"column":8}}`, }, { input: "()bar", want: `{"start":{"line":0,"column":0},"end":{"line":0,"column":5}}`, }, } for _, tt := range cases { t.Run("merge pattern", func(t *testing.T) { p := &parser{buf: []byte(tt.input), heuristics: parensAsPatterns} nodes, err := p.parseLeaves(Regexp) got := nodes[0].(Pattern).Annotation.Range.String() if err != nil { t.Error(err) } if diff := cmp.Diff(tt.want, got); diff != "" { t.Error(diff) } }) } }
explode_data.jsonl/49626
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 306 }
[ 2830, 3393, 52096, 57656, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 22427, 914, 198, 197, 50780, 220, 914, 198, 197, 59403, 197, 197, 515, 298, 22427, 25, 330, 7975, 368, 2257, 756, 298, 50780, 25, 220, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
func TestReconcileProberNotReady(t *testing.T) { table := TableTest{{ Name: "first reconcile basic ingress", Key: "ns/name", Objects: append([]runtime.Object{ ing("name", "ns", withBasicSpec, withContour), mustMakeProbe(t, ing("name", "ns", withBasicSpec, withContour), makeItReady), }, servicesAndEndpoints...), WantCreates: mustMakeProxies(t, ing("name", "ns", withBasicSpec, withContour)), WantStatusUpdates: []clientgotesting.UpdateActionImpl{{ Object: ing("name", "ns", withBasicSpec, withContour, func(i *v1alpha1.Ingress) { // These are the things we expect to change in status. i.Status.InitializeConditions() i.Status.MarkNetworkConfigured() i.Status.MarkLoadBalancerNotReady() }), }}, }} table.Test(t, MakeFactory(func(ctx context.Context, listers *Listers, cmw configmap.Watcher) controller.Reconciler { r := &Reconciler{ ingressClient: fakeingressclient.Get(ctx), contourClient: fakecontourclient.Get(ctx), ingressLister: listers.GetIngressLister(), contourLister: listers.GetHTTPProxyLister(), serviceLister: listers.GetK8sServiceLister(), tracker: &NullTracker{}, statusManager: &fakeStatusManager{ FakeIsReady: func(context.Context, *v1alpha1.Ingress) (bool, error) { return false, nil }, }, } return ingressreconciler.NewReconciler(ctx, logging.FromContext(ctx), fakeingressclient.Get(ctx), listers.GetIngressLister(), controller.GetEventRecorder(ctx), r, ContourIngressClassName, controller.Options{ ConfigStore: &testConfigStore{ config: defaultConfig, }}) })) }
explode_data.jsonl/49254
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 611 }
[ 2830, 3393, 693, 40446, 457, 1336, 652, 2623, 19202, 1155, 353, 8840, 836, 8, 341, 26481, 1669, 6633, 2271, 90, 515, 197, 21297, 25, 330, 3896, 63408, 6770, 78559, 756, 197, 55242, 25, 220, 330, 4412, 75992, 756, 197, 197, 11543, 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...
1
func TestDeletedSamplesAndSeriesStillInWALAfterCheckpoint(t *testing.T) { dir, err := ioutil.TempDir("", "test_delete_wal") testutil.Ok(t, err) defer func() { testutil.Ok(t, os.RemoveAll(dir)) }() wlog, err := wal.NewSize(nil, nil, dir, 32768) testutil.Ok(t, err) // Enough samples to cause a checkpoint. numSamples := 10000 hb, err := NewHead(nil, nil, wlog, int64(numSamples)*10) testutil.Ok(t, err) defer hb.Close() for i := 0; i < numSamples; i++ { app := hb.Appender() _, err := app.Add(labels.Labels{{"a", "b"}}, int64(i), 0) testutil.Ok(t, err) testutil.Ok(t, app.Commit()) } testutil.Ok(t, hb.Delete(0, int64(numSamples), labels.NewEqualMatcher("a", "b"))) testutil.Ok(t, hb.Truncate(1)) testutil.Ok(t, hb.Close()) // Confirm there's been a checkpoint. cdir, _, err := LastCheckpoint(dir) testutil.Ok(t, err) // Read in checkpoint and WAL. recs := readTestWAL(t, cdir) recs = append(recs, readTestWAL(t, dir)...) var series, samples, stones int for _, rec := range recs { switch rec.(type) { case []RefSeries: series++ case []RefSample: samples++ case []Stone: stones++ default: t.Fatalf("unknown record type") } } testutil.Equals(t, 1, series) testutil.Equals(t, 9999, samples) testutil.Equals(t, 1, stones) }
explode_data.jsonl/38164
{ "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, 26039, 39571, 3036, 25544, 23322, 641, 54, 969, 6025, 92688, 1155, 353, 8840, 836, 8, 341, 48532, 11, 1848, 1669, 43144, 65009, 6184, 19814, 330, 1944, 11353, 1670, 278, 1138, 18185, 1314, 54282, 1155, 11, 1848, 340, 16867, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestInitialization(t *testing.T) { type Aaa1 struct{} type Bbb1 struct { Aaa1 *Aaa1 `inject:""` } b := new(Bbb1) New(). WithObjects(new(Aaa1), b). InitializeGraph() assert.NotNil(t, b.Aaa1, "b=%#v", b) }
explode_data.jsonl/72954
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 111 }
[ 2830, 3393, 61928, 1155, 353, 8840, 836, 8, 341, 13158, 362, 5305, 16, 2036, 16094, 13158, 425, 6066, 16, 2036, 341, 197, 22985, 5305, 16, 353, 32, 5305, 16, 1565, 32133, 2974, 8805, 197, 630, 2233, 1669, 501, 5349, 6066, 16, 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, 1...
1
func TestScaleInt64(t *testing.T) { n1 := NewScalerInt64(0) require.Equal(t, uint32(0), n1.ScaleInt64(-1)) require.Equal(t, uint32(0), n1.ScaleInt64(0)) require.Equal(t, uint32(math.MaxUint32), n1.ScaleInt64(1)) n2 := NewScalerInt64(1 << 32) require.Equal(t, uint32(math.MaxUint32), n2.ScaleInt64(1<<32)) require.Equal(t, uint32(0x3fffffff), n2.ScaleInt64(1<<30)) }
explode_data.jsonl/30794
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 176 }
[ 2830, 3393, 6947, 1072, 21, 19, 1155, 353, 8840, 836, 8, 341, 9038, 16, 1669, 1532, 59553, 1072, 21, 19, 7, 15, 340, 17957, 12808, 1155, 11, 2622, 18, 17, 7, 15, 701, 308, 16, 51832, 1072, 21, 19, 4080, 16, 4390, 17957, 12808, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSmallWorldsBBUndirected(t *testing.T) { t.Parallel() for n := 2; n <= 20; n++ { for d := 1; d <= (n-1)/2; d++ { for p := 0.; p < 1; p += 0.1 { g := &gnUndirected{UndirectedBuilder: simple.NewUndirectedGraph()} orig := g.NewNode() g.AddNode(orig) err := SmallWorldsBB(g, n, d, p, nil) if err != nil { t.Fatalf("unexpected error: n=%d, d=%d, p=%v: %v", n, d, p, err) } if g.From(orig.ID()).Len() != 0 { t.Errorf("edge added from already existing node: n=%d, d=%d, p=%v", n, d, p) } if g.addBackwards { t.Errorf("edge added with From.ID > To.ID: n=%d, d=%d, p=%v", n, d, p) } if g.addSelfLoop { t.Errorf("unexpected self edge: n=%d, d=%d, p=%v", n, d, p) } if g.addMultipleEdge { t.Errorf("unexpected multiple edge: n=%d, d=%d, p=%v", n, d, p) } } } } }
explode_data.jsonl/52032
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 457 }
[ 2830, 3393, 25307, 10134, 82, 10098, 19957, 74612, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 2023, 308, 1669, 220, 17, 26, 308, 2651, 220, 17, 15, 26, 308, 1027, 341, 197, 2023, 294, 1669, 220, 16, 26, 294, 2651, 320, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
func TestZoektFileMatchToSymbolResults(t *testing.T) { symbolInfo := func(sym string) *zoekt.Symbol { return &zoekt.Symbol{ Sym: sym, Kind: "kind", Parent: "parent", ParentKind: "parentkind", } } file := &zoekt.FileMatch{ FileName: "bar.go", Repository: "foo", Language: "go", Version: "deadbeef", LineMatches: []zoekt.LineMatch{{ // Skips missing symbol info (shouldn't happen in practice). LineNumber: 5, LineFragments: []zoekt.LineFragmentMatch{{}}, }, { LineNumber: 10, LineFragments: []zoekt.LineFragmentMatch{{ SymbolInfo: symbolInfo("a"), }, { SymbolInfo: symbolInfo("b"), }}, }, { LineNumber: 15, LineFragments: []zoekt.LineFragmentMatch{{ SymbolInfo: symbolInfo("c"), }}, }}, } repo := &RepositoryResolver{repo: &types.Repo{Name: "foo"}} results := zoektFileMatchToSymbolResults(repo, "master", file) var symbols []protocol.Symbol for _, res := range results { // Check the fields which are not specific to the symbol if got, want := res.lang, "go"; got != want { t.Fatalf("lang: got %q want %q", got, want) } if got, want := res.baseURI.URL.String(), "git://foo?master"; got != want { t.Fatalf("baseURI: got %q want %q", got, want) } if got, want := string(res.commit.repoResolver.repo.Name), "foo"; got != want { t.Fatalf("reporesolver: got %q want %q", got, want) } if got, want := string(res.commit.oid), "deadbeef"; got != want { t.Fatalf("oid: got %q want %q", got, want) } if got, want := *res.commit.inputRev, "master"; got != want { t.Fatalf("inputRev: got %q want %q", got, want) } symbols = append(symbols, res.symbol) } want := []protocol.Symbol{{ Name: "a", Line: 10, }, { Name: "b", Line: 10, }, { Name: "c", Line: 15, }} for i := range want { want[i].Kind = "kind" want[i].Parent = "parent" want[i].ParentKind = "parentkind" want[i].Path = "bar.go" } if diff := cmp.Diff(want, symbols); diff != "" { t.Fatalf("symbol mismatch (-want +got):\n%s", diff) } }
explode_data.jsonl/52667
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 905 }
[ 2830, 3393, 57, 78, 17149, 1703, 8331, 1249, 15090, 9801, 1155, 353, 8840, 836, 8, 341, 1903, 4001, 1731, 1669, 2915, 62512, 914, 8, 353, 12738, 17149, 65995, 341, 197, 853, 609, 12738, 17149, 65995, 515, 298, 7568, 1600, 25, 286, 788...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFormat(t *testing.T) { bi := binfotypes.BuildInfo{ Frontend: "dockerfile.v0", Attrs: map[string]*string{ "build-arg:foo": stringPtr("bar"), "context:base": stringPtr("input:base"), "filename": stringPtr("Dockerfile"), "source": stringPtr("crazymax/dockerfile:master"), }, Sources: []binfotypes.Source{ { Type: "docker-image", Ref: "docker.io/library/busybox:latest", Pin: "sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578", }, { Type: "http", Ref: "https://raw.githubusercontent.com/moby/moby/master/README.md", Pin: "sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c", }, }, Deps: map[string]binfotypes.BuildInfo{ "base": { Frontend: "dockerfile.v0", Attrs: map[string]*string{ "build-arg:foo": stringPtr("bar"), "filename": stringPtr("Dockerfile2"), "source": stringPtr("crazymax/dockerfile:master"), }, Sources: []binfotypes.Source{ { Type: "docker-image", Ref: "docker.io/library/alpine:latest", Pin: "sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3", }, { Type: "docker-image", Ref: "docker.io/library/busybox:1.35.0", Pin: "sha256:20246233b52de844fa516f8c51234f1441e55e71ecdd1a1d91ebb252e1fd4603", }, }, }, }, } cases := []struct { name string formatopts FormatOpts want binfotypes.BuildInfo }{ { name: "unchanged", formatopts: FormatOpts{RemoveAttrs: false}, want: bi, }, { name: "remove attrs", formatopts: FormatOpts{RemoveAttrs: true}, want: binfotypes.BuildInfo{ Frontend: "dockerfile.v0", Sources: []binfotypes.Source{ { Type: "docker-image", Ref: "docker.io/library/alpine:latest", Pin: "sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3", }, { Type: "docker-image", Ref: "docker.io/library/busybox:1.35.0", Pin: "sha256:20246233b52de844fa516f8c51234f1441e55e71ecdd1a1d91ebb252e1fd4603", }, { Type: "docker-image", Ref: "docker.io/library/busybox:latest", Pin: "sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578", }, { Type: "http", Ref: "https://raw.githubusercontent.com/moby/moby/master/README.md", Pin: "sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c", }, }, }, }, } for _, tt := range cases { tt := tt t.Run(tt.name, func(t *testing.T) { dt, err := json.Marshal(bi) require.NoError(t, err) dt, err = Format(dt, tt.formatopts) require.NoError(t, err) var res binfotypes.BuildInfo err = json.Unmarshal(dt, &res) require.NoError(t, err) assert.Equal(t, tt.want, res) }) } }
explode_data.jsonl/44399
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1518 }
[ 2830, 3393, 4061, 1155, 353, 8840, 836, 8, 341, 2233, 72, 1669, 9544, 69, 21830, 25212, 1731, 515, 197, 12727, 9411, 408, 25, 330, 28648, 1192, 3133, 15, 756, 197, 197, 53671, 25, 2415, 14032, 8465, 917, 515, 298, 197, 1, 5834, 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 TestTxProofUnchangable(t *testing.T) { // run the other test a bunch... for i := 0; i < 40; i++ { testTxProofUnchangable(t) } }
explode_data.jsonl/57151
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 58 }
[ 2830, 3393, 31584, 31076, 1806, 77982, 480, 1155, 353, 8840, 836, 8, 341, 197, 322, 1598, 279, 1008, 1273, 264, 15493, 9338, 2023, 600, 1669, 220, 15, 26, 600, 366, 220, 19, 15, 26, 600, 1027, 341, 197, 18185, 31584, 31076, 1806, 77...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
func TestBatchLogsProcessor_Timeout(t *testing.T) { cfg := Config{ ProcessorSettings: config.NewProcessorSettings(config.NewComponentID(typeStr)), Timeout: 100 * time.Millisecond, SendBatchSize: 100, } requestCount := 5 logsPerRequest := 10 sink := new(consumertest.LogsSink) creationSet := componenttest.NewNopProcessorCreateSettings() batcher, err := newBatchLogsProcessor(creationSet, sink, &cfg, configtelemetry.LevelDetailed) require.NoError(t, err) require.NoError(t, batcher.Start(context.Background(), componenttest.NewNopHost())) start := time.Now() for requestNum := 0; requestNum < requestCount; requestNum++ { ld := testdata.GenerateLogsManyLogRecordsSameResource(logsPerRequest) assert.NoError(t, batcher.ConsumeLogs(context.Background(), ld)) } // Wait for at least one batch to be sent. for { if sink.LogRecordCount() != 0 { break } <-time.After(cfg.Timeout) } elapsed := time.Since(start) require.LessOrEqual(t, cfg.Timeout.Nanoseconds(), elapsed.Nanoseconds()) // This should not change the results in the sink, verified by the expectedBatchesNum require.NoError(t, batcher.Shutdown(context.Background())) expectedBatchesNum := 1 expectedBatchingFactor := 5 require.Equal(t, requestCount*logsPerRequest, sink.LogRecordCount()) receivedMds := sink.AllLogs() require.Equal(t, expectedBatchesNum, len(receivedMds)) for _, ld := range receivedMds { require.Equal(t, expectedBatchingFactor, ld.ResourceLogs().Len()) for i := 0; i < expectedBatchingFactor; i++ { require.Equal(t, logsPerRequest, ld.ResourceLogs().At(i).InstrumentationLibraryLogs().At(0).LogRecords().Len()) } } }
explode_data.jsonl/25032
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 594 }
[ 2830, 3393, 21074, 51053, 22946, 39080, 411, 1155, 353, 8840, 836, 8, 341, 50286, 1669, 5532, 515, 197, 197, 22946, 6086, 25, 2193, 7121, 22946, 6086, 8754, 7121, 2189, 915, 5808, 2580, 6965, 197, 197, 7636, 25, 1843, 220, 16, 15, 15,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestGAInit(t *testing.T) { var ga, err = NewDefaultGAConfig().NewGA() if err != nil { t.Errorf("Expected nil, got %v", err) } if ga.Populations != nil { t.Errorf("Expected nil, got %v", ga.Populations) } if ga.HallOfFame != nil { t.Errorf("Expected nil, got %v", ga.HallOfFame) } ga.NPops = 2 ga.PopSize = 21 ga.HofSize = 3 if err = ga.init(NewVector); err != nil { t.Errorf("Expected nil, got %v", err) } if l := len(ga.Populations); l != 2 { t.Errorf("Expected 2, got %d", l) } if l := len(ga.Populations[0].Individuals); l != 21 { t.Errorf("Expected 21, got %d", l) } if l := len(ga.Populations[1].Individuals); l != 21 { t.Errorf("Expected 21, got %d", l) } if l := len(ga.HallOfFame); l != 3 { t.Errorf("Expected 3, got %d", l) } }
explode_data.jsonl/82074
{ "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, 16128, 3803, 1155, 353, 8840, 836, 8, 341, 2405, 13510, 11, 1848, 284, 1532, 3675, 16128, 2648, 1005, 3564, 16128, 741, 743, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 18896, 2092, 11, 2684, 1018, 85, 497, 1848, 340, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
func TestConvertInvalTermsets(t *testing.T) { syms := &datalog.SymbolTable{} tokenTestCases := []struct { desc string in datalog.Set }{ { desc: "empty set", in: datalog.Set{}, }, { desc: "mixed element types", in: datalog.Set{ syms.Insert("abc"), datalog.Integer(1), }, }, { desc: "set with variables", in: datalog.Set{ datalog.Variable(0), datalog.Variable(1), }, }, { desc: "set with sub sets", in: datalog.Set{ datalog.Set{ syms.Insert("abc"), syms.Insert("def"), }, }, }, } protoTestCases := []struct { desc string in *pb.TermV2 }{ { desc: "empty set", in: &pb.TermV2{Content: &pb.TermV2_Set{Set: &pb.TermSet{ Set: []*pb.TermV2{}, }}}, }, { desc: "mixed element types", in: &pb.TermV2{Content: &pb.TermV2_Set{Set: &pb.TermSet{ Set: []*pb.TermV2{ {Content: &pb.TermV2_String_{String_: syms.Index("abc")}}, {Content: &pb.TermV2_Integer{Integer: 0}}, }, }}}, }, { desc: "set with variables", in: &pb.TermV2{Content: &pb.TermV2_Set{Set: &pb.TermSet{ Set: []*pb.TermV2{ {Content: &pb.TermV2_Variable{Variable: 1}}, }, }}}, }, { desc: "set with sub sets", in: &pb.TermV2{Content: &pb.TermV2_Set{Set: &pb.TermSet{ Set: []*pb.TermV2{ {Content: &pb.TermV2_Set{Set: &pb.TermSet{Set: []*pb.TermV2{ {Content: &pb.TermV2_String_{String_: syms.Index("abc")}}, }}}}, }, }}}, }, } for _, tc := range tokenTestCases { t.Run(tc.desc, func(t *testing.T) { _, err := tokenIDToProtoIDV2(tc.in) require.Error(t, err) }) } for _, tc := range protoTestCases { t.Run(tc.desc, func(t *testing.T) { _, err := protoIDToTokenIDV2(tc.in) require.Error(t, err) }) } }
explode_data.jsonl/51996
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 936 }
[ 2830, 3393, 12012, 641, 831, 17249, 4917, 1155, 353, 8840, 836, 8, 341, 1903, 75025, 1669, 609, 67, 7750, 65995, 2556, 31483, 43947, 2271, 37302, 1669, 3056, 1235, 341, 197, 41653, 914, 198, 197, 17430, 256, 3258, 30951, 4202, 198, 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 TestExpandBlockStorageV2AttachMode(t *testing.T) { expected := volumeactions.ReadWrite actual, err := expandBlockStorageV2AttachMode("rw") assert.Equal(t, err, nil) assert.Equal(t, expected, actual) }
explode_data.jsonl/74645
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 71 }
[ 2830, 3393, 38946, 4713, 5793, 53, 17, 30485, 3636, 1155, 353, 8840, 836, 8, 341, 42400, 1669, 8123, 4020, 6503, 7985, 271, 88814, 11, 1848, 1669, 9225, 4713, 5793, 53, 17, 30485, 3636, 445, 31768, 1138, 6948, 12808, 1155, 11, 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
func TestOperationPHP(t *testing.T) { cpu := testCPU cpu.Reset() oldStatus := byte(0x30) stkp := cpu.stkp PHP(cpu) stackedStatus, e := cpu.CPURead(Stack + Word(stkp)) assertNil(t, e) assertEqualsB(t, oldStatus, stackedStatus) }
explode_data.jsonl/73054
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 104 }
[ 2830, 3393, 8432, 15158, 1155, 353, 8840, 836, 8, 341, 80335, 1669, 1273, 31615, 198, 80335, 36660, 2822, 61828, 2522, 1669, 4922, 7, 15, 87, 18, 15, 692, 18388, 48495, 1669, 17319, 1236, 48495, 198, 10025, 6610, 48814, 340, 48227, 291,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetIconWithFallBackURL(t *testing.T) { req, err := http.NewRequest("GET", "/icon?url=apple.com&size=400&fallback_icon_url=http%3A%2F%2Fexample.com", nil) if err != nil { log.Fatal(err) } w := httptest.NewRecorder() iconHandler(w, req) assertStringEquals(t, "302", fmt.Sprintf("%d", w.Code)) assertStringEquals(t, "max-age=86400", w.Header().Get("Cache-Control")) assertStringEquals(t, "http://example.com", w.Header().Get("Location")) }
explode_data.jsonl/25591
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 183 }
[ 2830, 3393, 1949, 4395, 2354, 49772, 3707, 3144, 1155, 353, 8840, 836, 8, 341, 24395, 11, 1848, 1669, 1758, 75274, 445, 3806, 497, 3521, 1924, 94399, 28, 22377, 905, 5, 2141, 28, 19, 15, 15, 5, 73311, 15648, 2903, 34717, 4, 18, 32, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAutoCancelAllOpenOrders(t *testing.T) { t.Parallel() if !areTestAPIKeysSet() || !canManipulateRealOrders { t.Skip("skipping test: api keys not set or canManipulateRealOrders set to false") } _, err := b.AutoCancelAllOpenOrders(context.Background(), currency.NewPairWithDelimiter("BTCUSD", "PERP", "_"), 30000) if err != nil { t.Error(err) } }
explode_data.jsonl/76623
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 137 }
[ 2830, 3393, 13253, 9269, 2403, 5002, 24898, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 743, 753, 546, 2271, 7082, 8850, 1649, 368, 1369, 753, 4814, 92876, 6334, 12768, 24898, 341, 197, 3244, 57776, 445, 4886, 5654, 1273, 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 TestReadCookies(t *testing.T) { for i, tt := range readCookiesTests { for n := 0; n < 2; n++ { // to verify readCookies doesn't mutate its input c := readCookies(tt.Header, tt.Filter) if !reflect.DeepEqual(c, tt.Cookies) { t.Errorf("#%d readCookies:\nhave: %s\nwant: %s\n", i, toJSON(c), toJSON(tt.Cookies)) continue } } } }
explode_data.jsonl/20298
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 161 }
[ 2830, 3393, 4418, 50672, 1155, 353, 8840, 836, 8, 341, 2023, 600, 11, 17853, 1669, 2088, 1349, 50672, 18200, 341, 197, 2023, 308, 1669, 220, 15, 26, 308, 366, 220, 17, 26, 308, 1027, 314, 442, 311, 10146, 1349, 50672, 3171, 944, 671...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReconcileOnCompletedPipelineRun(t *testing.T) { // TestReconcileOnCompletedPipelineRun runs "Reconcile" on a PipelineRun that already reached completion // and that does not have the latest status from TaskRuns yet. It checks that the TaskRun status is updated // in the PipelineRun status, that the completion status is not altered, that not error is returned and // a successful event is triggered taskRunName := "test-pipeline-run-completed-hello-world" prs := []*v1beta1.PipelineRun{{ ObjectMeta: baseObjectMeta("test-pipeline-run-completed", "foo"), Spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: "test-pipeline"}, ServiceAccountName: "test-sa", }, Status: v1beta1.PipelineRunStatus{ Status: duckv1beta1.Status{ Conditions: duckv1beta1.Conditions{ apis.Condition{ Type: apis.ConditionSucceeded, Status: corev1.ConditionTrue, Reason: v1beta1.PipelineRunReasonSuccessful.String(), Message: "All Tasks have completed executing", }, }, }, PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ TaskRuns: map[string]*v1beta1.PipelineRunTaskRunStatus{ taskRunName: { PipelineTaskName: "hello-world-1", Status: &v1beta1.TaskRunStatus{}, }, }, }, }, }} ps := []*v1beta1.Pipeline{simpleHelloWorldPipeline} ts := []*v1beta1.Task{simpleHelloWorldTask} trs := []*v1beta1.TaskRun{createHelloWorldTaskRunWithStatus(taskRunName, "foo", "test-pipeline-run-completed", "test-pipeline", "", apis.Condition{ Type: apis.ConditionSucceeded, })} d := test.Data{ PipelineRuns: prs, Pipelines: ps, Tasks: ts, TaskRuns: trs, } prt := newPipelineRunTest(d, t) defer prt.Cancel() wantEvents := []string{ "Normal Succeeded All Tasks have completed executing", } reconciledRun, clients := prt.reconcileRun("foo", "test-pipeline-run-completed", wantEvents, false) actions := clients.Pipeline.Actions() if len(actions) < 2 { t.Errorf("# Actions: %d, Actions: %#v", len(actions), actions) t.Fatalf("Expected client to have at least two action implementation") } _ = getPipelineRunUpdates(t, actions) pipelineUpdates := 0 for _, action := range actions { if action != nil { switch { case action.Matches("create", "taskruns"): t.Errorf("Expected client to not have created a TaskRun, but it did") case action.Matches("update", "pipelineruns"): pipelineUpdates++ } } } if pipelineUpdates != 1 { // If only the pipelinerun status changed, we expect one update t.Fatalf("Expected client to have updated the pipelinerun twice, but it did %d times", pipelineUpdates) } // This PipelineRun should still be complete and the status should reflect that if reconciledRun.Status.GetCondition(apis.ConditionSucceeded).IsUnknown() { t.Errorf("Expected PipelineRun status to be complete, but was %v", reconciledRun.Status.GetCondition(apis.ConditionSucceeded)) } expectedTaskRunsStatus := make(map[string]*v1beta1.PipelineRunTaskRunStatus) expectedTaskRunsStatus[taskRunName] = &v1beta1.PipelineRunTaskRunStatus{ PipelineTaskName: "hello-world-1", Status: &v1beta1.TaskRunStatus{ Status: duckv1beta1.Status{ Conditions: []apis.Condition{{Type: apis.ConditionSucceeded}}, }, }, } if d := cmp.Diff(reconciledRun.Status.TaskRuns, expectedTaskRunsStatus); d != "" { t.Fatalf("Expected PipelineRun status to match TaskRun(s) status, but got a mismatch %s", diff.PrintWantGot(d)) } }
explode_data.jsonl/68256
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1370 }
[ 2830, 3393, 693, 40446, 457, 1925, 22724, 34656, 6727, 1155, 353, 8840, 836, 8, 341, 197, 322, 3393, 693, 40446, 457, 1925, 22724, 34656, 6727, 8473, 330, 693, 40446, 457, 1, 389, 264, 40907, 6727, 429, 2669, 8643, 9755, 198, 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...
9
func TestCanRebuildIndex(t *testing.T) { testPath, err := ioutil.TempDir("./", "test") if err != nil { t.Fatal(err) } defer (func() { os.RemoveAll(testPath) })() store, err := NewStore(Config{ BasePath: testPath, }) require.NoError(t, err) store.Put("key1", []byte("value1")) store.Put("key2", []byte("value2")) store.Put("key3", []byte("value3")) store.Close() newStore, err := NewStore(Config{ BasePath: testPath, }) require.NoError(t, err) val1, err := newStore.Get("key1") require.NoError(t, err) val2, err := newStore.Get("key2") require.NoError(t, err) val3, err := newStore.Get("key3") require.NoError(t, err) require.Equal(t, "value1", string(val1)) require.Equal(t, "value2", string(val2)) require.Equal(t, "value3", string(val3)) }
explode_data.jsonl/82522
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 331 }
[ 2830, 3393, 6713, 693, 5834, 1552, 1155, 353, 8840, 836, 8, 341, 18185, 1820, 11, 1848, 1669, 43144, 65009, 6184, 13988, 497, 330, 1944, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 16867, 320, 2830, 368, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCountRune(t *testing.T) { cs := []struct { w int s string b rune }{ {0, "123", '0'}, {1, "123", '2'}, {2, "12一一3", '一'}, } for i, c := range cs { a := CountRune(c.s, c.b) if a != c.w { t.Errorf("[%d] CountRune(%q, %q) = %v, want %v", i, c.s, c.b, a, c.w) } } }
explode_data.jsonl/80910
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 176 }
[ 2830, 3393, 2507, 49, 2886, 1155, 353, 8840, 836, 8, 341, 71899, 1669, 3056, 1235, 341, 197, 6692, 526, 198, 197, 1903, 914, 198, 197, 2233, 63499, 198, 197, 59403, 197, 197, 90, 15, 11, 330, 16, 17, 18, 497, 364, 15, 11688, 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 TestRemoveEmptyStrings(t *testing.T) { stringsTests := []struct { name string source []string want []string }{ {"no strings", []string{}, []string{}}, {"no empty strings", []string{"test1", "test2"}, []string{"test1", "test2"}}, {"mixed strings", []string{"", "test2", ""}, []string{"test2"}}, } for _, tt := range stringsTests { t.Run(tt.name, func(rt *testing.T) { got := RemoveEmptyStrings(tt.source) if diff := cmp.Diff(tt.want, got); diff != "" { rt.Fatalf("string removal failed:\n%s", diff) } }) } }
explode_data.jsonl/31479
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 224 }
[ 2830, 3393, 13021, 3522, 20859, 1155, 353, 8840, 836, 8, 341, 11355, 819, 18200, 1669, 3056, 1235, 341, 197, 11609, 256, 914, 198, 197, 47418, 3056, 917, 198, 197, 50780, 256, 3056, 917, 198, 197, 59403, 197, 197, 4913, 2152, 9069, 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 TestHelpArgInternals(t *testing.T) { t.Parallel() tests := []struct { name string method string reflectType reflect.Type defaults map[int]reflect.Value help string }{ { name: "command with no args", method: "test", reflectType: func() reflect.Type { type s struct{} return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "", }, { name: "command with one required arg", method: "test", reflectType: func() reflect.Type { type s struct { Field int } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. field (json-type-numeric, help-required) test-field\n", }, { name: "command with one optional arg, no default", method: "test", reflectType: func() reflect.Type { type s struct { Optional *int } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. optional (json-type-numeric, help-optional) test-optional\n", }, { name: "command with one optional arg with default", method: "test", reflectType: func() reflect.Type { type s struct { Optional *string } return reflect.TypeOf((*s)(nil)) }(), defaults: func() map[int]reflect.Value { defVal := "test" return map[int]reflect.Value{ 0: reflect.ValueOf(&defVal), } }(), help: "1. optional (json-type-string, help-optional, help-default=\"test\") test-optional\n", }, { name: "command with struct field", method: "test", reflectType: func() reflect.Type { type s2 struct { F int8 } type s struct { Field s2 } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. field (json-type-object, help-required) test-field\n" + "{\n" + " \"f\": n, (json-type-numeric) s2-f\n" + "} \n", }, { name: "command with map field", method: "test", reflectType: func() reflect.Type { type s struct { Field map[string]float64 } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. field (json-type-object, help-required) test-field\n" + "{\n" + " \"test-field--key\": test-field--value, (json-type-object) test-field--desc\n" + " ...\n" + "}\n", }, { name: "command with slice of primitives field", method: "test", reflectType: func() reflect.Type { type s struct { Field []int64 } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. field (json-type-arrayjson-type-numeric, help-required) test-field\n", }, { name: "command with slice of structs field", method: "test", reflectType: func() reflect.Type { type s2 struct { F int64 } type s struct { Field []s2 } return reflect.TypeOf((*s)(nil)) }(), defaults: nil, help: "1. field (json-type-arrayjson-type-object, help-required) test-field\n" + "[{\n" + " \"f\": n, (json-type-numeric) s2-f\n" + "},...]\n", }, } xT := func(key string) string { return key } t.Logf("Running %d tests", len(tests)) for i, test := range tests { help := btcjson.TstArgHelp(xT, test.reflectType, test.defaults, test.method) if help != test.help { t.Errorf("Test #%d (%s) unexpected help - got:\n%v\n"+ "want:\n%v", i, test.name, help, test.help) continue } } }
explode_data.jsonl/14412
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1557 }
[ 2830, 3393, 12689, 2735, 67916, 1127, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 78216, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 42257, 414, 914, 198, 197, 197, 34913, 929, 8708, 10184, 198, 197, 11940, 82, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestTextmateSnippetOffset(t *testing.T) { snippet := parse("te$1xt", false) snippetChildren := *snippet.children() assertEqual(t, snippet.offset(snippetChildren[0]), 0) assertEqual(t, snippet.offset(snippetChildren[1]), 2) assertEqual(t, snippet.offset(snippetChildren[2]), 2) snippet = parse("${TM_SELECTED_TEXT:def}", false) snippetChildren = *snippet.children() assertEqual(t, snippet.offset(snippetChildren[0]), 0) assertMarkerTypes(t, snippetChildren[0], &variable{}) assertEqual(t, snippet.offset((*snippetChildren[0].(*variable).children())[0]), 0) // forgein marker assertEqual(t, snippet.offset(newText("foo")), -1) }
explode_data.jsonl/60286
{ "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, 1178, 18052, 87852, 6446, 1155, 353, 8840, 836, 8, 341, 48251, 21581, 1669, 4715, 445, 665, 3, 16, 2252, 497, 895, 340, 48251, 21581, 11539, 1669, 353, 57615, 13360, 741, 6948, 2993, 1155, 11, 43065, 14760, 59865, 21581, 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 TestReader_Read(t *testing.T) { t.Run("should return ErrEOL when no entries were written before", func(t *testing.T) { reader := tests.OpenLogReader(t) _, data, err := reader.Read() assert.ErrorIs(t, err, log.ErrEOL) assert.Nil(t, data) }) t.Run("should read two entries written using two writers", func(t *testing.T) { l, writer1 := tests.OpenLogWithWriter(t) t1, _ := writer1.Write(data1) _ = writer1.Close() writer2, _ := l.OpenWriter() t2, err := writer2.Write(data1) defer tests.Close(t, writer2) require.NoError(t, err) // when entries := tests.ReadAll(t, l) // then assert.Len(t, entries, 2) assert.True(t, entries[0].Time.Equal(t1)) assert.True(t, entries[1].Time.Equal(t2)) }) t.Run("should read entries starting from given time", func(t *testing.T) { t.Run("when given time is before than first entry", func(t *testing.T) { firstEntryTime := time2006 l, writer := tests.OpenLogWithWriter(t, log.NowFunc(fixedNow(firstEntryTime))) t1, _ := writer.Write(data1) givenTime := time2005 // when actual := tests.ReadAll(t, l, log.StartingFrom(givenTime)) // then require.Len(t, actual, 1) assert.True(t, t1.Equal(actual[0].Time)) assert.Equal(t, data1, actual[0].Data) }) t.Run("when given time is after the last entry", func(t *testing.T) { firstEntryTime := time2005 l, writer := tests.OpenLogWithWriter(t, log.NowFunc(fixedNow(firstEntryTime))) _, _ = writer.Write(data1) givenTime := time2006 // when actual := tests.ReadAll(t, l, log.StartingFrom(givenTime)) // then require.Len(t, actual, 0) }) t.Run("when entry is at the end of the sole segment", func(t *testing.T) { l, writer := tests.OpenLogWithWriter(t) _, _ = writer.Write(data1) t2, _ := writer.Write(data2) // when actual := tests.ReadAll(t, l, log.StartingFrom(t2)) // then require.Len(t, actual, 1) assert.True(t, t2.Equal(actual[0].Time)) assert.Equal(t, data2, actual[0].Data) }) t.Run("when given time is between two entries in a sole segment", func(t *testing.T) { currentTime := time.Time{} clock := tests.Clock{CurrentTime: &currentTime} l, writer := tests.OpenLogWithWriter(t, log.NowFunc(clock.Now)) t1, _ := writer.Write(data1) clock.MoveForward(time.Hour) t2, _ := writer.Write(data2) // when afterT1beforeT2 := t1.Add(time.Minute) actual := tests.ReadAll(t, l, log.StartingFrom(afterT1beforeT2)) // then require.Len(t, actual, 1) assert.True(t, t2.Equal(actual[0].Time)) assert.Equal(t, data2, actual[0].Data) }) t.Run("when entry is at the beginning of second segment", func(t *testing.T) { currentTime := time.Time{} clock := tests.Clock{CurrentTime: &currentTime} l, writer := tests.OpenLogWithWriter(t, log.NowFunc(clock.Now), log.MaxSegmentDuration(time.Minute)) clock.MoveForward(time.Hour) _, _ = writer.Write(data1) t2, _ := writer.Write(data2) // when actual := tests.ReadAll(t, l, log.StartingFrom(t2)) // then require.Len(t, actual, 1) assert.True(t, t2.Equal(actual[0].Time)) assert.Equal(t, data2, actual[0].Data) }) }) }
explode_data.jsonl/63515
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1312 }
[ 2830, 3393, 5062, 38381, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 5445, 470, 15495, 36, 1930, 979, 902, 10695, 1033, 5326, 1573, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 61477, 1669, 7032, 12953, 2201, 5062, 1155, 340, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestPrintNodeOSImage(t *testing.T) { table := []struct { node api.Node expected []metav1.TableRow }{ { node: api.Node{ ObjectMeta: metav1.ObjectMeta{Name: "foo1"}, Status: api.NodeStatus{ NodeInfo: api.NodeSystemInfo{OSImage: "fake-os-image"}, Addresses: []api.NodeAddress{{Type: api.NodeExternalIP, Address: "1.1.1.1"}}, }, }, // Columns: Name, Status, Roles, Age, KubeletVersion, NodeInternalIP, NodeExternalIP, OSImage, KernelVersion, ContainerRuntimeVersion expected: []metav1.TableRow{ { Cells: []interface{}{"foo1", "Unknown", "<none>", "<unknown>", "", "<none>", "1.1.1.1", "fake-os-image", "<unknown>", "<unknown>"}, }, }, }, { node: api.Node{ ObjectMeta: metav1.ObjectMeta{Name: "foo2"}, Status: api.NodeStatus{ NodeInfo: api.NodeSystemInfo{KernelVersion: "fake-kernel-version"}, Addresses: []api.NodeAddress{{Type: api.NodeExternalIP, Address: "1.1.1.1"}}, }, }, // Columns: Name, Status, Roles, Age, KubeletVersion, NodeInternalIP, NodeExternalIP, OSImage, KernelVersion, ContainerRuntimeVersion expected: []metav1.TableRow{ { Cells: []interface{}{"foo2", "Unknown", "<none>", "<unknown>", "", "<none>", "1.1.1.1", "<unknown>", "fake-kernel-version", "<unknown>"}, }, }, }, } for i, test := range table { rows, err := printNode(&test.node, printers.GenerateOptions{Wide: true}) if err != nil { t.Fatalf("An error occurred generating table for Node: %#v", 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/21589
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 705 }
[ 2830, 3393, 8994, 1955, 3126, 1906, 1155, 353, 8840, 836, 8, 1476, 26481, 1669, 3056, 1235, 341, 197, 20831, 257, 6330, 21714, 198, 197, 42400, 3056, 4059, 402, 16, 18257, 3102, 198, 197, 59403, 197, 197, 515, 298, 20831, 25, 6330, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSuspendResume(t *testing.T) { wf := unmarshalWF(stepsTemplateParallelismLimit) cancel, controller := newController(wf) defer cancel() wfcset := controller.wfclientset.ArgoprojV1alpha1().Workflows("") // suspend the workflow ctx := context.Background() err := util.SuspendWorkflow(ctx, wfcset, wf.ObjectMeta.Name) assert.NoError(t, err) wf, err = wfcset.Get(ctx, wf.ObjectMeta.Name, metav1.GetOptions{}) assert.NoError(t, err) assert.True(t, *wf.Spec.Suspend) // operate should not result in no workflows being created since it is suspended woc := newWorkflowOperationCtx(wf, controller) woc.operate(ctx) pods, err := listPods(woc) assert.NoError(t, err) assert.Equal(t, 0, len(pods.Items)) // resume the workflow and operate again. two pods should be able to be scheduled err = util.ResumeWorkflow(ctx, wfcset, controller.hydrator, wf.ObjectMeta.Name, "") assert.NoError(t, err) wf, err = wfcset.Get(ctx, wf.ObjectMeta.Name, metav1.GetOptions{}) assert.NoError(t, err) assert.Nil(t, wf.Spec.Suspend) woc = newWorkflowOperationCtx(wf, controller) woc.operate(ctx) pods, err = listPods(woc) assert.NoError(t, err) assert.Equal(t, 2, len(pods.Items)) }
explode_data.jsonl/70966
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 469 }
[ 2830, 3393, 50, 12758, 28563, 1155, 353, 8840, 836, 8, 341, 6692, 69, 1669, 650, 27121, 32131, 84271, 7275, 16547, 2142, 16527, 340, 84441, 11, 6461, 1669, 501, 2051, 3622, 69, 340, 16867, 9121, 741, 6692, 8316, 746, 1669, 6461, 1418, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSocketPVAddress(t *testing.T) { for _, tc := range socketTestCases(t) { // Execute the test within a closure to ensure the deferred statements // are called between each for loop iteration, for isolated test cases. func() { var ( chainID = cmn.RandStr(12) validatorEndpoint, serviceEndpoint = testSetupSocketPair(t, chainID, types.NewMockPV(), tc.addr, tc.dialer) ) defer validatorEndpoint.Stop() defer serviceEndpoint.Stop() serviceAddr := serviceEndpoint.privVal.GetPubKey().Address() validatorAddr := validatorEndpoint.GetPubKey().Address() assert.Equal(t, serviceAddr, validatorAddr) }() } }
explode_data.jsonl/77978
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 261 }
[ 2830, 3393, 10286, 48469, 4286, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 17130, 1669, 2088, 7575, 2271, 37302, 1155, 8, 341, 197, 197, 322, 20848, 279, 1273, 2878, 264, 21955, 311, 5978, 279, 26239, 12239, 198, 197, 197, 322, 525, 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...
1
func TestMerge(t *testing.T) { p1 := New() p1.Set("1", "1") p1.Set("2", "2") p1.Set("3", "3") p2 := New() p2.Set("4", "4") p2.Set("2", "b") r := New() r.Set("1", "1") r.Set("2", "b") r.Set("3", "3") r.Set("4", "4") n := Merge(p1, p2) assert.Equal(t, r, n) p1.Merge(p2) assert.Equal(t, r, p1) }
explode_data.jsonl/1466
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 188 }
[ 2830, 3393, 52096, 1155, 353, 8840, 836, 8, 341, 3223, 16, 1669, 1532, 741, 3223, 16, 4202, 445, 16, 497, 330, 16, 1138, 3223, 16, 4202, 445, 17, 497, 330, 17, 1138, 3223, 16, 4202, 445, 18, 497, 330, 18, 5130, 3223, 17, 1669, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestRESTClientSingleObject(t *testing.T) { tc := restClientTestCase{ desiredMetricValues: PodMetricsInfo{"some-dep": {Value: 10}}, metricName: "queue-length", targetTimestamp: 1, reportedMetricPoints: []metricPoint{{10, 1}}, singleObject: &autoscalingapi.CrossVersionObjectReference{ APIVersion: "apps/v1", Kind: "Deployment", Name: "some-dep", }, } tc.runTest(t) }
explode_data.jsonl/64901
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 185 }
[ 2830, 3393, 38307, 2959, 10888, 1190, 1155, 353, 8840, 836, 8, 341, 78255, 1669, 2732, 2959, 16458, 515, 197, 52912, 2690, 54310, 6227, 25, 220, 16821, 27328, 1731, 4913, 14689, 6810, 79, 788, 314, 1130, 25, 220, 16, 15, 22050, 197, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestVerifyPgp(t *testing.T) { tcs := []struct { name string signature []byte publicKey []byte expectedErr bool }{ { name: "valid signature and public key", signature: []byte(gpgSignature), publicKey: []byte(gpgPublicKey), expectedErr: false, }, { name: "invalid signature", signature: []byte("invalid-sig"), publicKey: []byte(gpgPublicKey), expectedErr: true, }, { name: "invalid public key", signature: []byte(gpgSignature), publicKey: []byte("invalid-public-key"), expectedErr: true, }, } v := pgpVerifierImpl{} for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { actualPayload, err := v.verifyPgp(tc.signature, tc.publicKey) if tc.expectedErr { if err == nil { t.Fatalf("Expected error, but returned none") } } else { if err != nil { t.Fatalf("Unexpected error: %v", err) } expectedPayload := []byte(testPayload) if string(actualPayload) != string(expectedPayload) { t.Errorf("Incorrect payload extracted: got: %s, want: %s", string(actualPayload), string(expectedPayload)) } } }) } }
explode_data.jsonl/48093
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 533 }
[ 2830, 3393, 32627, 47, 21888, 1155, 353, 8840, 836, 8, 341, 3244, 4837, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 69054, 1568, 256, 3056, 3782, 198, 197, 1219, 1592, 256, 3056, 3782, 198, 197, 42400, 7747, 1807, 198, 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...
5
func TestCaptiveIsPreparedCoreContextCancelled(t *testing.T) { mockRunner := &stellarCoreRunnerMock{} ctx, cancel := context.WithCancel(context.Background()) mockRunner.On("context").Return(ctx).Maybe() mockRunner.On("getProcessExitError").Return(false, nil) rang := UnboundedRange(100) captiveBackend := CaptiveStellarCore{ nextLedger: 100, prepared: &rang, stellarCoreRunner: mockRunner, } result := captiveBackend.isPrepared(UnboundedRange(100)) assert.True(t, result) cancel() result = captiveBackend.isPrepared(UnboundedRange(100)) assert.False(t, result) }
explode_data.jsonl/7336
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 222 }
[ 2830, 3393, 34, 27781, 3872, 4703, 7212, 5386, 1972, 39473, 1155, 353, 8840, 836, 8, 341, 77333, 19486, 1669, 609, 77293, 5386, 19486, 11571, 16094, 20985, 11, 9121, 1669, 2266, 26124, 9269, 5378, 19047, 2398, 77333, 19486, 8071, 445, 214...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGormConfig(t *testing.T) { t.Run("test gorm config", func(t *testing.T) { gormConfig := gormConfig(false) if !reflect.DeepEqual(gormConfig.Logger, Default.LogMode(logger.Error)) { t.Errorf("gorm config logger want %+v but get %+v", Default.LogMode(logger.Error), gormConfig.Logger) } }) }
explode_data.jsonl/19488
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 124 }
[ 2830, 3393, 38, 493, 2648, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 1944, 342, 493, 2193, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 3174, 493, 2648, 1669, 342, 493, 2648, 3576, 340, 197, 743, 753, 34913, 94750, 3268, 493,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEtcd(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) junitReporter := reporters.NewJUnitReporter("../../../report/etcd_suite.xml") RunSpecsWithDefaultAndCustomReporters(t, "Etcd Suite", []Reporter{junitReporter}) }
explode_data.jsonl/79285
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 94 }
[ 2830, 3393, 31860, 4385, 1155, 353, 8840, 836, 8, 341, 18185, 6031, 3839, 1941, 2201, 20341, 2461, 38, 766, 3346, 741, 79096, 19524, 3050, 7832, 604, 340, 12428, 3843, 52766, 1669, 19040, 7121, 56248, 52766, 445, 26744, 11736, 14, 295, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEc2Instance_LoadDetails_InstanceSubnet_IsNull(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() ec2Instance, mockEC2ApiHelper := getMockInstance(ctrl) mockEC2ApiHelper.EXPECT().GetInstanceDetails(&instanceID).Return(nwInterfaces, nil) mockEC2ApiHelper.EXPECT().GetSubnet(&subnetID).Return(nil, nil) err := ec2Instance.LoadDetails(mockEC2ApiHelper) assert.NotNil(t, err) }
explode_data.jsonl/753
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 153 }
[ 2830, 3393, 50730, 17, 2523, 19553, 7799, 70849, 3136, 4711, 31879, 3280, 1155, 353, 8840, 836, 8, 341, 84381, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 16867, 23743, 991, 18176, 2822, 197, 757, 17, 2523, 11, 7860, 7498, 17, 6563, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRoundRobinLoadBalancer_OneOf_ConnectionLost(t *testing.T) { lb := cluster.NewRoundRobinLoadBalancer() // directly set the index (*lb) = 5 addr := lb.OneOf([]cluster.Address{"a:5071", "b:5701", "c:5701"}) // since the index is greater than available addresses, LB should return the last address assert.Equal(t, cluster.Address("c:5701"), addr) }
explode_data.jsonl/62450
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 121 }
[ 2830, 3393, 27497, 76671, 5879, 93825, 68201, 2124, 85002, 47253, 1155, 353, 8840, 836, 8, 341, 8810, 65, 1669, 10652, 7121, 27497, 76671, 5879, 93825, 741, 197, 322, 5961, 738, 279, 1922, 198, 197, 4071, 21123, 8, 284, 220, 20, 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...
1
func TestProjectJsonDep(t *testing.T) { bp := ` rust_library { name: "liba", srcs: ["a/src/lib.rs"], crate_name: "a" } rust_library { name: "libb", srcs: ["b/src/lib.rs"], crate_name: "b", rlibs: ["liba"], } ` jsonContent := testProjectJson(t, bp) validateJsonCrates(t, jsonContent) }
explode_data.jsonl/25962
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 152 }
[ 2830, 3393, 7849, 5014, 7839, 1155, 353, 8840, 836, 8, 341, 2233, 79, 1669, 22074, 7000, 590, 39461, 341, 197, 11609, 25, 330, 2740, 64, 756, 197, 41144, 82, 25, 4383, 64, 13437, 8194, 25638, 8097, 197, 1444, 7698, 1269, 25, 330, 64...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestInstrumentationLibraryMetrics_CopyTo(t *testing.T) { ms := NewInstrumentationLibraryMetrics() NewInstrumentationLibraryMetrics().CopyTo(ms) assert.True(t, ms.IsNil()) generateTestInstrumentationLibraryMetrics().CopyTo(ms) assert.EqualValues(t, generateTestInstrumentationLibraryMetrics(), ms) }
explode_data.jsonl/19502
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 100 }
[ 2830, 3393, 56324, 367, 16915, 27328, 77637, 1249, 1155, 353, 8840, 836, 8, 341, 47691, 1669, 1532, 56324, 367, 16915, 27328, 741, 197, 3564, 56324, 367, 16915, 27328, 1005, 12106, 1249, 35680, 340, 6948, 32443, 1155, 11, 9829, 4506, 1906...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTaskSortByDueDate(t *testing.T) { testTasklist.LoadFromPath(testInputSort) taskID := 17 testTasklist = testTasklist[taskID : taskID+4] if err := testTasklist.Sort(SortDueDateAsc); err != nil { t.Fatal(err) } testExpectedList = []string{ "x 2014-01-02 (B) 2013-12-30 Create golang library test cases @Go +go-todotxt", "x 2014-01-03 Create golang library @Go +go-todotxt due:2014-01-05", "x (C) 2014-01-01 Create golang library documentation @Go +go-todotxt due:2014-01-12", "(B) 2013-12-01 Outline chapter 5 @Computer +Novel Level:5 private:false due:2014-02-17", } checkTaskListOrder(t, testTasklist, testExpectedList) if err := testTasklist.Sort(SortDueDateDesc); err != nil { t.Fatal(err) } testExpectedList = []string{ "(B) 2013-12-01 Outline chapter 5 @Computer +Novel Level:5 private:false due:2014-02-17", "x (C) 2014-01-01 Create golang library documentation @Go +go-todotxt due:2014-01-12", "x 2014-01-03 Create golang library @Go +go-todotxt due:2014-01-05", "x 2014-01-02 (B) 2013-12-30 Create golang library test cases @Go +go-todotxt", } checkTaskListOrder(t, testTasklist, testExpectedList) }
explode_data.jsonl/24864
{ "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, 6262, 10231, 1359, 33060, 1916, 1155, 353, 8840, 836, 8, 341, 18185, 6262, 1607, 13969, 3830, 1820, 8623, 2505, 10231, 340, 49115, 915, 1669, 220, 16, 22, 271, 18185, 6262, 1607, 284, 1273, 6262, 1607, 58, 8202, 915, 549, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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