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 TestMultipleCreateChannel(t *testing.T) { var wg sync.WaitGroup report := test.CheckRoutines(t) defer report() // Two OnDataChannel // One OnNegotiationNeeded wg.Add(3) pcOffer, _ := NewPeerConnection(Configuration{}) pcAnswer, _ := NewPeerConnection(Configuration{}) pcAnswer.OnDataChannel(func(d *DataChannel) { wg.Done() }) pcOffer.OnNegotiationNeeded(func() { offer, err := pcOffer.CreateOffer(nil) assert.NoError(t, err) offerGatheringComplete := GatheringCompletePromise(pcOffer) if err = pcOffer.SetLocalDescription(offer); err != nil { t.Error(err) } <-offerGatheringComplete if err = pcAnswer.SetRemoteDescription(*pcOffer.LocalDescription()); err != nil { t.Error(err) } answer, err := pcAnswer.CreateAnswer(nil) assert.NoError(t, err) answerGatheringComplete := GatheringCompletePromise(pcAnswer) if err = pcAnswer.SetLocalDescription(answer); err != nil { t.Error(err) } <-answerGatheringComplete if err = pcOffer.SetRemoteDescription(*pcAnswer.LocalDescription()); err != nil { t.Error(err) } wg.Done() }) if _, err := pcOffer.CreateDataChannel("initial_data_channel_0", nil); err != nil { t.Error(err) } if _, err := pcOffer.CreateDataChannel("initial_data_channel_1", nil); err != nil { t.Error(err) } wg.Wait() closePairNow(t, pcOffer, pcAnswer) }
explode_data.jsonl/8652
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 508 }
[ 2830, 3393, 32089, 4021, 9629, 1155, 353, 8840, 836, 8, 341, 2405, 63581, 12811, 28384, 2808, 271, 69931, 1669, 1273, 10600, 49, 28628, 1155, 340, 16867, 1895, 2822, 197, 322, 9043, 1913, 1043, 9629, 198, 197, 322, 3776, 1913, 47800, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestScenario527(t *testing.T) { spec.ParallelTest(t, &driver.Scenario{ PreCheck: func() { testAccPreCheck(t) }, Id: "527", Vars: func(scenario *driver.Scenario) map[string]interface{} { return map[string]interface{}{ "DiskType": "DataDisk", "Size": 1, "UDataArkMode": "Yes", "Name": "udisk_ark", "snapshot_name1": "udisk_ark_snap1", "snapshot_name2": "udisk_ark_snap2", "snapshot_comment1": "snap1_comment", "snapshot_comment2": "snap2_comment", "udiskName_ark_snapclone": "udisk_ark_snapclone", "udiskName_noark_snapclone": "udisk_noark_snapclone", "Region": "cn-bj2", "Zone": "cn-bj2-03", } }, Owners: []string{"maggie.an@ucloud.cn"}, Title: "UDisk-普通方舟盘_04", Steps: []*driver.Step{ testStep527DescribeUDiskPrice01, testStep527CheckUDiskAllowance02, testStep527CreateUDisk03, testStep527DescribeUDisk04, testStep527SetUDiskUDataArkMode05, testStep527DescribeUDisk06, testStep527CreateUDiskSnapshot07, testStep527DescribeUDiskSnapshot08, testStep527UpdateUDiskSnapshotInfo09, testStep527DescribeUDiskSnapshot10, testStep527CloneUDiskSnapshot11, testStep527DescribeUDisk12, testStep527CloneUDiskSnapshot13, testStep527DescribeUDisk14, testStep527RestoreUDisk15, testStep527DescribeUDisk16, testStep527DeleteUDiskSnapshot17, testStep527DescribeUDiskSnapshot18, testStep527DescribeUDisk19, testStep527DeleteUDisk20, testStep527DeleteUDisk21, testStep527DeleteUDisk22, }, }) }
explode_data.jsonl/21835
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 856 }
[ 2830, 3393, 54031, 20, 17, 22, 1155, 353, 8840, 836, 8, 341, 98100, 41288, 7957, 2271, 1155, 11, 609, 12521, 18326, 20413, 515, 197, 197, 4703, 3973, 25, 2915, 368, 341, 298, 18185, 14603, 4703, 3973, 1155, 340, 197, 197, 1583, 197, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestGetServerTime(t *testing.T) { b.SetDefaults() _, err := b.GetServerTime() if err != nil { t.Fatalf("Test failed. Err: %s", err) } }
explode_data.jsonl/14536
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 63 }
[ 2830, 3393, 1949, 5475, 1462, 1155, 353, 8840, 836, 8, 341, 2233, 4202, 16273, 741, 197, 6878, 1848, 1669, 293, 2234, 5475, 1462, 741, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 2271, 4641, 13, 15495, 25, 1018, 82, 497, 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 ]
2
func TestClassifyTable(t *testing.T) { testCases := map[string]int{ "15:30": classifier.TimeClass, "aveebeesfs": classifier.LetterClass, "2/3/2015": classifier.DateClass, "avvsasa?1223121wff...": classifier.NoClass, "2.1.2.2.3": classifier.NumberClass, } textIdx := 0 for s,r := range testCases { t.Logf("Test %v:\twhen trying to classify %v, checking for class %v",textIdx, s, r) res := classifier.Classify(s) if res != r { t.Fatalf("\t%s\tshould return %v", failed, r) } t.Logf("\t%s\tshould return %v", succeed, r) textIdx++ } }
explode_data.jsonl/29454
{ "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, 1957, 1437, 2556, 1155, 353, 8840, 836, 8, 1476, 18185, 37302, 1669, 2415, 14032, 63025, 515, 197, 197, 1, 16, 20, 25, 18, 15, 788, 33365, 16299, 1957, 345, 197, 197, 1, 523, 68, 1371, 288, 3848, 788, 33365, 1214, 21405,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServerHTTP10ConnectionClose(t *testing.T) { ln := fasthttputil.NewInmemoryListener() ch := make(chan struct{}) go func() { err := Serve(ln, func(ctx *RequestCtx) { // The server must close the connection irregardless // of request and response state set inside request // handler, since the HTTP/1.0 request // had no 'Connection: keep-alive' header. ctx.Request.Header.ResetConnectionClose() ctx.Request.Header.Set("Connection", "keep-alive") ctx.Response.Header.ResetConnectionClose() ctx.Response.Header.Set("Connection", "keep-alive") }) if err != nil { t.Fatalf("unexpected error: %s", err) } close(ch) }() conn, err := ln.Dial() if err != nil { t.Fatalf("unexpected error: %s", err) } _, err = fmt.Fprintf(conn, "%s", "GET / HTTP/1.0\r\nHost: aaa\r\n\r\n") if err != nil { t.Fatalf("error when writing request: %s", err) } br := bufio.NewReader(conn) var resp Response if err = resp.Read(br); err != nil { t.Fatalf("error when reading response: %s", err) } if !resp.ConnectionClose() { t.Fatalf("HTTP1.0 response must have 'Connection: close' header") } tailCh := make(chan struct{}) go func() { tail, err := ioutil.ReadAll(br) if err != nil { t.Fatalf("error when reading tail: %s", err) } if len(tail) > 0 { t.Fatalf("unexpected non-zero tail %q", tail) } close(tailCh) }() select { case <-tailCh: case <-time.After(time.Second): t.Fatalf("timeout when reading tail") } if err = conn.Close(); err != nil { t.Fatalf("error when closing the connection: %s", err) } if err = ln.Close(); err != nil { t.Fatalf("error when closing listener: %s", err) } select { case <-ch: case <-time.After(time.Second): t.Fatalf("timeout when waiting for the server to stop") } }
explode_data.jsonl/73283
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 698 }
[ 2830, 3393, 5475, 9230, 16, 15, 4526, 7925, 1155, 353, 8840, 836, 8, 341, 197, 2261, 1669, 4937, 96336, 628, 321, 7121, 641, 17269, 2743, 2822, 23049, 1669, 1281, 35190, 2036, 37790, 30680, 2915, 368, 341, 197, 9859, 1669, 52932, 94925,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestWebhookMigration(t *testing.T) { testNS := "test-ns" // Mutating webhook configuration. whc := &admissionv1.MutatingWebhookConfiguration{ ObjectMeta: metav1.ObjectMeta{ Name: oldWebhookResourceName, }, } // Webhook Service. svc := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: oldWebhookResourceName, Namespace: testNS, }, } testcases := []struct { name string existingResources []runtime.Object }{ { name: "webhook resources don't exist", }, { name: "webhook resources exist", existingResources: []runtime.Object{whc, svc}, }, } for _, tc := range testcases { tc := tc t.Run(tc.name, func(t *testing.T) { cli := fake.NewFakeClient(tc.existingResources...) ctx := context.TODO() if err := webhookMigration(ctx, cli, log, testNS); err != nil { t.Errorf("failed running webhook migration: %v", err) } // Check if the resources exist. checkObjectExists(t, ctx, cli, whc) checkObjectExists(t, ctx, cli, svc) }) } }
explode_data.jsonl/59375
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 440 }
[ 2830, 3393, 5981, 20873, 20168, 1155, 353, 8840, 836, 8, 341, 18185, 2448, 1669, 330, 1944, 12, 4412, 1837, 197, 322, 31228, 1095, 75268, 6546, 624, 197, 1312, 66, 1669, 609, 329, 2728, 85, 16, 1321, 332, 1095, 5981, 20873, 7688, 515,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestDoNotForwardAccessTokenUpstream(t *testing.T) { patTest, err := NewPassAccessTokenTest(PassAccessTokenTestOptions{ PassAccessToken: false, ValidToken: true, }) if err != nil { t.Fatal(err) } t.Cleanup(patTest.Close) // A successful validation will redirect and set the auth cookie. code, cookie := patTest.getCallbackEndpoint() if code != 302 { t.Fatalf("expected 302; got %d", code) } assert.NotEqual(t, nil, cookie) // Now we make a regular request, but the access token header should // not be present. code, payload := patTest.getEndpointWithCookie(cookie, "/") if code != 200 { t.Fatalf("expected 200; got %d", code) } assert.Equal(t, "No access token found.", payload) }
explode_data.jsonl/36389
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 251 }
[ 2830, 3393, 5404, 2623, 25925, 37649, 2324, 4027, 1155, 353, 8840, 836, 8, 341, 3223, 266, 2271, 11, 1848, 1669, 1532, 12187, 37649, 2271, 5304, 395, 37649, 2271, 3798, 515, 197, 10025, 395, 37649, 25, 895, 345, 197, 197, 4088, 3323, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
func TestNewMedianFetcherFromURLs_EmptyError(t *testing.T) { s1 := httptest.NewServer(fakePriceResponder(t, ethUSDPairing, decimal.NewFromInt(101))) defer s1.Close() var urls []*url.URL _, err := newMedianFetcherFromURLs(defaultHTTPTimeout, ethUSDPairing, urls, 32768) require.Error(t, err) }
explode_data.jsonl/26494
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 118 }
[ 2830, 3393, 3564, 79514, 97492, 3830, 3144, 82, 76060, 1595, 1454, 1155, 353, 8840, 836, 8, 341, 1903, 16, 1669, 54320, 70334, 7121, 5475, 74138, 6972, 30884, 1155, 11, 8372, 2034, 10298, 1310, 287, 11, 12122, 7121, 3830, 1072, 7, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestToken(t *testing.T) { licenseStr := "0QFGbwit-" token, err := BasePack([]byte(licenseStr)) if err != nil { fmt.Printf("error") } fmt.Printf("token is: %v\n", token) fmt.Printf("len is %v\n", len(token)) }
explode_data.jsonl/31207
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 98 }
[ 2830, 3393, 3323, 1155, 353, 8840, 836, 8, 341, 197, 13266, 2580, 1669, 330, 15, 48, 12001, 39824, 275, 12, 698, 43947, 11, 1848, 1669, 5351, 30684, 10556, 3782, 7, 13266, 2580, 1171, 743, 1848, 961, 2092, 341, 197, 11009, 19367, 445,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestParseWithFuncsInvalidType(t *testing.T) { var c int err := ParseWithFuncs(&c, nil) assert.EqualError(t, err, "env: expected a pointer to a Struct") }
explode_data.jsonl/78786
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 60 }
[ 2830, 3393, 14463, 2354, 9626, 82, 7928, 929, 1155, 353, 8840, 836, 8, 341, 2405, 272, 526, 198, 9859, 1669, 14775, 2354, 9626, 82, 2099, 66, 11, 2092, 340, 6948, 12808, 1454, 1155, 11, 1848, 11, 330, 3160, 25, 3601, 264, 7445, 311,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPropagationWithGlobalPropagators(t *testing.T) { tracer := mocktrace.NewTracer("test-tracer") r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) handlerFunc := func(req *restful.Request, resp *restful.Response) { span := oteltrace.SpanFromContext(req.Request.Context()) mspan, ok := span.(*mocktrace.Span) require.True(t, ok) assert.Equal(t, pspan.SpanContext().TraceID, mspan.SpanContext().TraceID) assert.Equal(t, pspan.SpanContext().SpanID, mspan.ParentSpanID) w.WriteHeader(http.StatusOK) } ws := &restful.WebService{} ws.Route(ws.GET("/user/{id}").To(handlerFunc)) container := restful.NewContainer() container.Filter(restfultrace.OTelFilter("foobar", restfultrace.WithTracer(tracer))) container.Add(ws) container.ServeHTTP(w, r) }
explode_data.jsonl/50854
{ "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, 35172, 2354, 11646, 2008, 351, 2973, 1155, 353, 8840, 836, 8, 341, 25583, 9584, 1669, 7860, 15067, 7121, 1282, 9584, 445, 1944, 10188, 9584, 5130, 7000, 1669, 54320, 70334, 75274, 445, 3806, 497, 3521, 872, 14, 16, 17, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestEmbeddedInlineStruct(t *testing.T) { callErr, funcErr, assert, callBuffer, funcBuffer := testOpenAPITypeWriter(t, ` package foo // Nested is used as embedded inline struct field type Nested struct { // A simple string String string } // Blah demonstrate a struct with embedded inline struct field. type Blah struct { // An embedded inline struct field Nested `+"`"+`json:",inline,omitempty"`+"`"+` } `) if callErr != nil { t.Fatal(callErr) } if funcErr != nil { t.Fatal(funcErr) } assert.Equal(`"base/foo.Blah": schema_base_foo_Blah(ref), `, callBuffer.String()) assert.Equal(`func schema_base_foo_Blah(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "Blah demonstrate a struct with embedded inline struct field.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "String": { SchemaProps: spec.SchemaProps{ Description: "A simple string", Default: "", Type: []string{"string"}, Format: "", }, }, }, Required: []string{"String"}, }, }, } } `, funcBuffer.String()) }
explode_data.jsonl/3346
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 395 }
[ 2830, 3393, 83466, 25324, 9422, 1155, 353, 8840, 836, 8, 341, 67288, 7747, 11, 2915, 7747, 11, 2060, 11, 1618, 4095, 11, 2915, 4095, 1669, 1273, 5002, 7082, 929, 6492, 1155, 11, 22074, 1722, 15229, 271, 322, 71742, 374, 1483, 438, 228...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetTradeHistory(t *testing.T) { _, err := p.GetTradeHistory("BTC_XMR", "", "") if err != nil { t.Error("Test faild - Poloniex GetTradeHistory() error", err) } }
explode_data.jsonl/23563
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 69 }
[ 2830, 3393, 1949, 39173, 13424, 1155, 353, 8840, 836, 8, 341, 197, 6878, 1848, 1669, 281, 2234, 39173, 13424, 445, 59118, 6859, 18446, 497, 7342, 14676, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 445, 2271, 3690, 67, 481, 3651, 20783, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNewGithubProject(t *testing.T) { t.Parallel() p, err := newGithubFS(context.Background(), mockClient(), "github.com/x/y", nil) require.NoError(t, err) assert.Equal(t, "heads/master", p.ref) }
explode_data.jsonl/11439
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 81 }
[ 2830, 3393, 3564, 78717, 7849, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 3223, 11, 1848, 1669, 501, 78717, 8485, 5378, 19047, 1507, 7860, 2959, 1507, 330, 5204, 905, 10776, 26491, 497, 2092, 340, 17957, 35699, 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 TestMetadata(t *testing.T) { meta := &Metadata{ MimeType: "audio/aiff", Size: 12345, } _, err := meta.Bytes() if err != nil { t.Fatal(err) } metaPB, err := BytesForMetadata(meta) if err != nil { t.Fatal(err) } meta, err = MetadataFromBytes(metaPB) if err != nil { t.Fatal(err) } mimeAiff := meta.MimeType == "audio/aiff" if !mimeAiff { t.Fatal("Metadata does not Marshal and Unmarshal properly!") } }
explode_data.jsonl/42604
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 202 }
[ 2830, 3393, 14610, 1155, 353, 8840, 836, 8, 341, 84004, 1669, 609, 14610, 515, 197, 9209, 34872, 25, 330, 16736, 14186, 3092, 756, 197, 91224, 25, 257, 220, 16, 17, 18, 19, 20, 345, 197, 630, 197, 6878, 1848, 1669, 8823, 36868, 741,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestNumberOfRetryAttemptsIsZeroForNewJob(t *testing.T) { withRepository(func(r *RedisJobRepository) { testJob := addLeasedJob(t, r, "some-queue", "cluster-1") retries, err := r.GetNumberOfRetryAttempts(testJob.Id) assert.Nil(t, err) assert.Zero(t, retries) }) }
explode_data.jsonl/32064
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 114 }
[ 2830, 3393, 40619, 51560, 81517, 3872, 17999, 2461, 3564, 12245, 1155, 353, 8840, 836, 8, 341, 46948, 4624, 18552, 2601, 353, 48137, 12245, 4624, 8, 341, 197, 18185, 12245, 1669, 912, 2304, 1475, 12245, 1155, 11, 435, 11, 330, 14689, 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 TestDefaultBridges(t *testing.T) { assert := assert.New(t) h := hypervisor{DefaultBridges: 0} bridges := h.defaultBridges() assert.Equal(defaultBridgesCount, bridges) h.DefaultBridges = maxPCIBridges + 1 bridges = h.defaultBridges() assert.Equal(maxPCIBridges, bridges) h.DefaultBridges = maxPCIBridges bridges = h.defaultBridges() assert.Equal(maxPCIBridges, bridges) }
explode_data.jsonl/5134
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 139 }
[ 2830, 3393, 3675, 33, 1869, 4188, 1155, 353, 8840, 836, 8, 341, 6948, 1669, 2060, 7121, 1155, 692, 9598, 1669, 9751, 31396, 90, 3675, 33, 1869, 4188, 25, 220, 15, 630, 197, 16223, 4188, 1669, 305, 8764, 33, 1869, 4188, 741, 6948, 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 TestValSetApplyUpdatesTestsExecute(t *testing.T) { valSetUpdatesBasicTests := []struct { startVals []testVal updateVals []testVal expectedVals []testVal }{ // additions 0: { // prepend []testVal{{"v4", 44}, {"v5", 55}}, []testVal{{"v1", 11}}, []testVal{{"v1", 11}, {"v4", 44}, {"v5", 55}}}, 1: { // append []testVal{{"v4", 44}, {"v5", 55}}, []testVal{{"v6", 66}}, []testVal{{"v4", 44}, {"v5", 55}, {"v6", 66}}}, 2: { // insert []testVal{{"v4", 44}, {"v6", 66}}, []testVal{{"v5", 55}}, []testVal{{"v4", 44}, {"v5", 55}, {"v6", 66}}}, 3: { // insert multi []testVal{{"v4", 44}, {"v6", 66}, {"v9", 99}}, []testVal{{"v5", 55}, {"v7", 77}, {"v8", 88}}, []testVal{{"v4", 44}, {"v5", 55}, {"v6", 66}, {"v7", 77}, {"v8", 88}, {"v9", 99}}}, // changes 4: { // head []testVal{{"v1", 111}, {"v2", 22}}, []testVal{{"v1", 11}}, []testVal{{"v1", 11}, {"v2", 22}}}, 5: { // tail []testVal{{"v1", 11}, {"v2", 222}}, []testVal{{"v2", 22}}, []testVal{{"v1", 11}, {"v2", 22}}}, 6: { // middle []testVal{{"v1", 11}, {"v2", 222}, {"v3", 33}}, []testVal{{"v2", 22}}, []testVal{{"v1", 11}, {"v2", 22}, {"v3", 33}}}, 7: { // multi []testVal{{"v1", 111}, {"v2", 222}, {"v3", 333}}, []testVal{{"v1", 11}, {"v2", 22}, {"v3", 33}}, []testVal{{"v1", 11}, {"v2", 22}, {"v3", 33}}}, // additions and changes 8: { []testVal{{"v1", 111}, {"v2", 22}}, []testVal{{"v1", 11}, {"v3", 33}, {"v4", 44}}, []testVal{{"v1", 11}, {"v2", 22}, {"v3", 33}, {"v4", 44}}}, } for i, tt := range valSetUpdatesBasicTests { // create a new validator set with the start values valSet := createNewValidatorSet(tt.startVals) // applyUpdates() with the update values valList := createNewValidatorList(tt.updateVals) valSet.applyUpdates(valList) // check the new list of validators for proper merge assert.Equal(t, toTestValList(valSet.Validators), tt.expectedVals, "test %v", i) } }
explode_data.jsonl/28333
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 938 }
[ 2830, 3393, 2208, 1649, 28497, 37091, 18200, 17174, 1155, 353, 8840, 836, 8, 341, 19302, 1649, 37091, 15944, 18200, 1669, 3056, 1235, 341, 197, 21375, 52452, 262, 3056, 1944, 2208, 198, 197, 27175, 52452, 256, 3056, 1944, 2208, 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...
2
func TestLookupIngressesByDomain(t *testing.T) { refIng1 := &v1beta1.Ingress{ ObjectMeta: v1.ObjectMeta{ Name: "test-ingress-ref1", Namespace: "test-ns-ref", Annotations: map[string]string{ string(IngressClass): Istio, }, }, Spec: v1beta1.IngressSpec{ Rules: []v1beta1.IngressRule{ { Host: "test-ref1.abc.company.com", }, { Host: "test-ref1.xyz.company.com", }, }, }, } refIng2 := &v1beta1.Ingress{ ObjectMeta: v1.ObjectMeta{ Name: "test-ingress-ref2", Namespace: "test-ns-ref", Annotations: map[string]string{ string(IngressClass): Istio, }, }, Spec: v1beta1.IngressSpec{ Rules: []v1beta1.IngressRule{ { Host: "test-ref2.abc.company.com", }, }, }, } refIng3 := &v1beta1.Ingress{ ObjectMeta: v1.ObjectMeta{ Name: "test-ingress-ref3", Namespace: "test-ns-ref3", Annotations: map[string]string{ string(IngressClass): Istio, }, }, Spec: v1beta1.IngressSpec{ Rules: []v1beta1.IngressRule{ { Host: "test-ref1.abc.company.com", }, { Host: "test-ref3.xyz.company.com", }, }, }, } helper.SetIndexer(cache.NewIndexer( cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{ Istio: helper.GetProviderByName(Istio).DomainsIndexFunc, })) helper.indexer.Add(refIng1) helper.indexer.Add(refIng2) helper.indexer.Add(refIng3) type input struct { index string domain string } type output struct { ingresses [](*v1beta1.Ingress) err error } tests := []struct { name string given input expected output }{ { "should return error when index doesn't exist", input{ "undefined", "test-ref1.abc.company.com", }, output{ nil, errors.New("undefined"), }, }, { "should return correct ingress for test-ref1.xyz.company.com", input{ Istio, "test-ref1.xyz.company.com", }, output{ [](*v1beta1.Ingress){ refIng1, }, nil, }, }, { "should return correct ingress for test-ref2.abc.company.com", input{ Istio, "test-ref2.abc.company.com", }, output{ [](*v1beta1.Ingress){ refIng2, }, nil, }, }, { "should return correct multiple ingresses for test-ref1.abc.company.com", input{ Istio, "test-ref1.abc.company.com", }, output{ [](*v1beta1.Ingress){ refIng1, refIng3, }, nil, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { var actual output actual.ingresses, actual.err = helper.lookupIngressesByDomain(test.given.index, test.given.domain) if test.expected.err != nil { assert.NotNil(t, actual.err, "err should not be nil: "+test.name) } else { assert.Nil(t, actual.err, "err should be nil: "+test.name) } assert.Equal(t, test.expected.ingresses, actual.ingresses, test.name) }) } }
explode_data.jsonl/15645
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1448 }
[ 2830, 3393, 34247, 641, 2483, 288, 1359, 13636, 1155, 353, 8840, 836, 8, 341, 59504, 25416, 16, 1669, 609, 85, 16, 19127, 16, 5337, 2483, 515, 197, 23816, 12175, 25, 348, 16, 80222, 515, 298, 21297, 25, 414, 330, 1944, 83905, 673, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestMakeHostingDotConfigTopologiesIgnoreDSS(t *testing.T) { cdnName := "cdn0" server := makeGenericServer() server.HostName = util.StrPtr("server0") server.Cachegroup = util.StrPtr("edgeCG") server.CDNName = &cdnName server.CDNID = util.IntPtr(400) server.ProfileID = util.IntPtr(46) server.ID = util.IntPtr(899) server.Profile = util.StrPtr("serverprofile") hdr := "myHeaderComment" serverParams := []tc.Parameter{ tc.Parameter{ Name: ParamRAMDrivePrefix, ConfigFile: HostingConfigParamConfigFile, Value: "ParamRAMDrivePrefix-shouldnotappearinconfig", Profiles: []byte(`["` + *server.Profile + `"]`), }, tc.Parameter{ Name: ParamDrivePrefix, ConfigFile: HostingConfigParamConfigFile, Value: "ParamDrivePrefix-shouldnotappearinconfig", Profiles: []byte(`["` + *server.Profile + `"]`), }, tc.Parameter{ Name: "somethingelse", ConfigFile: HostingConfigParamConfigFile, Value: "somethingelse-shouldnotappearinconfig", Profiles: []byte(`["` + *server.Profile + `"]`), }, } dsTopology := makeGenericDS() dsTopology.OrgServerFQDN = util.StrPtr("https://origin0.example.net") dsTopology.XMLID = util.StrPtr("ds-topology") dsTopology.CDNID = util.IntPtr(400) dsTopology.ID = util.IntPtr(900) dsTopology.Topology = util.StrPtr("t0") dsTopology.Active = util.BoolPtr(true) dsType := tc.DSTypeHTTP dsTopology.Type = &dsType dsTopologyWithoutServer := makeGenericDS() dsTopologyWithoutServer.ID = util.IntPtr(901) dsTopologyWithoutServer.OrgServerFQDN = util.StrPtr("https://origin1.example.net") dsTopologyWithoutServer.XMLID = util.StrPtr("ds-topology-without-server") dsTopologyWithoutServer.CDNID = util.IntPtr(400) dsTopologyWithoutServer.Topology = util.StrPtr("t1") dsTopologyWithoutServer.Active = util.BoolPtr(true) dsType2 := tc.DSTypeHTTP dsTopologyWithoutServer.Type = &dsType2 dses := []DeliveryService{*dsTopology, *dsTopologyWithoutServer} topologies := []tc.Topology{ tc.Topology{ Name: "t0", Nodes: []tc.TopologyNode{ tc.TopologyNode{ Cachegroup: "edgeCG", Parents: []int{1}, }, tc.TopologyNode{ Cachegroup: "midCG", }, }, }, tc.Topology{ Name: "t1", Nodes: []tc.TopologyNode{ tc.TopologyNode{ Cachegroup: "otherEdgeCG", Parents: []int{1}, }, tc.TopologyNode{ Cachegroup: "midCG", }, }, }, } servers := []Server{*server} dss := makeDSS(servers, dses) cfg, err := MakeHostingDotConfig(server, servers, serverParams, dses, dss, topologies, hdr) if err != nil { t.Fatal(err) } txt := cfg.Text if !strings.Contains(txt, "origin0") { t.Errorf("expected origin0 in topology, actual %v\n", txt) } if strings.Contains(txt, "origin1") { t.Errorf("expected no origin1 not in topology, actual %v\n", txt) } }
explode_data.jsonl/22615
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1186 }
[ 2830, 3393, 8078, 84921, 34207, 2648, 5366, 9090, 12497, 35, 1220, 1155, 353, 8840, 836, 8, 341, 1444, 17395, 675, 1669, 330, 12254, 15, 1837, 41057, 1669, 1281, 19964, 5475, 741, 41057, 29840, 675, 284, 4094, 27318, 5348, 445, 4030, 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...
4
func TestConfigureAffinityTraitDoesSucceed(t *testing.T) { affinityTrait, environment, _ := createNominalAffinityTest() configured, err := affinityTrait.Configure(environment) assert.True(t, configured) assert.Nil(t, err) }
explode_data.jsonl/10350
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 78 }
[ 2830, 3393, 28560, 25841, 13489, 49257, 21468, 50, 29264, 1155, 353, 8840, 836, 8, 341, 197, 2649, 13489, 49257, 11, 4573, 11, 716, 1669, 1855, 36312, 977, 25841, 13489, 2271, 741, 25873, 3073, 11, 1848, 1669, 50452, 49257, 78281, 67591, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestExpandPrivateReleaseAddressInput(t *testing.T) { rd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ "ip_type": true, "private_ip": "192.168.0.1", }) rd.SetId("192.168.0.1") tests := []struct { name string args *schema.ResourceData want *computing.ReleaseAddressInput }{ { name: "expands the resource data", args: rd, want: &computing.ReleaseAddressInput{ PrivateIpAddress: nifcloud.String("192.168.0.1"), }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := expandReleaseAddressInput(tt.args) assert.Equal(t, tt.want, got) }) } }
explode_data.jsonl/35518
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 273 }
[ 2830, 3393, 38946, 16787, 16077, 4286, 2505, 1155, 353, 8840, 836, 8, 341, 92356, 1669, 10802, 8787, 4783, 1043, 20015, 1155, 11, 501, 8632, 1507, 2415, 14032, 31344, 67066, 197, 197, 1, 573, 1819, 788, 262, 830, 345, 197, 197, 1, 199...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLiveCleanUp(t *testing.T) { if !envTest.IsLiveTest() { t.Skip("skipping live test") } envTest.RestoreEnv() provider, err := NewDNSProvider() require.NoError(t, err) err = provider.CleanUp(envTest.GetDomain(), "", "123d==") require.NoError(t, err) }
explode_data.jsonl/69084
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 108 }
[ 2830, 3393, 20324, 27529, 2324, 1155, 353, 8840, 836, 8, 341, 743, 753, 3160, 2271, 4506, 20324, 2271, 368, 341, 197, 3244, 57776, 445, 4886, 5654, 3887, 1273, 1138, 197, 630, 57538, 2271, 31129, 460, 14359, 741, 197, 19979, 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...
2
func Test_NewForConfigError(t *testing.T) { k8sapi := &k8s.API{} oldInClusterConfigFn := k8s.InClusterConfigFn defer func() { k8s.InClusterConfigFn = oldInClusterConfigFn }() k8s.InClusterConfigFn = func() (*rest.Config, error) { return new(rest.Config), nil } oldNewConfigFn := k8s.NewConfigFn defer func() { k8s.NewConfigFn = oldNewConfigFn }() expected := "could not create Clientset from KubeConfig" k8s.NewConfigFn = func(config *rest.Config) (*kubernetes.Clientset, error) { return nil, fmt.Errorf(expected) } _, err := k8sapi.GetStorageClasses() assert.True(t, err != nil) if err != nil { assert.Equal(t, expected, err.Error()) } }
explode_data.jsonl/29792
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 273 }
[ 2830, 3393, 39582, 2461, 2648, 1454, 1155, 353, 8840, 836, 8, 341, 16463, 23, 82, 2068, 1669, 609, 74, 23, 82, 24922, 31483, 61828, 641, 28678, 2648, 24911, 1669, 595, 23, 82, 5337, 28678, 2648, 24911, 198, 16867, 2915, 368, 314, 595,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServiceCreateImageSync(t *testing.T) { action, created, output, err := fakeServiceCreate([]string{ "service", "create", "foo", "--image", "gcr.io/foo/bar:baz"}, false) if err != nil { t.Fatal(err) } else if !action.Matches("create", "services") { t.Fatalf("Bad action %v", action) } template := &created.Spec.Template if err != nil { t.Fatal(err) } if template.Spec.Containers[0].Image != "gcr.io/foo/bar:baz" { t.Fatalf("wrong image set: %v", template.Spec.Containers[0].Image) } if !strings.Contains(output, "foo") || !strings.Contains(output, "Creating") || !strings.Contains(output, commands.FakeNamespace) { t.Fatalf("wrong stdout message: %v", output) } if !strings.Contains(output, "Ready") { t.Fatalf("not running in sync mode") } }
explode_data.jsonl/42441
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 301 }
[ 2830, 3393, 1860, 4021, 1906, 12154, 1155, 353, 8840, 836, 8, 341, 38933, 11, 3465, 11, 2550, 11, 1848, 1669, 12418, 1860, 4021, 10556, 917, 515, 197, 197, 1, 7936, 497, 330, 3182, 497, 330, 7975, 497, 14482, 1805, 497, 330, 70, 508...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCheckerDelay(t *testing.T) { batchc := make(chan []*service.HandlersEndpointsV1Digest, 2) fake := &fakeIsolateService{batchc: batchc} checker := newChecker(context.Background(), fake, 8) nop := func(item *Item, ps *isolatedclient.PushState) {} checker.AddItem(&Item{Digest: "aaa"}, false, nop) checker.AddItem(&Item{Digest: "bbb"}, false, nop) <-batchc // Block until a batch is sent. checker.AddItem(&Item{Digest: "ccc"}, false, nop) if err := checker.Close(); err != nil { t.Fatalf("checker.Close: got error %v; want %v", err, nil) } // Check that we have 2 batches (of 2 and 1 items respectively). if got, want := len(fake.itemBatches), 2; got != want { t.Errorf("checker received %d batches, want %d", got, want) } for i, batch := range fake.itemBatches { if got, want := len(batch), 2-i; got != want { t.Errorf("checker batch[%d] has len %d, want %d", i, got, want) } } }
explode_data.jsonl/70502
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 351 }
[ 2830, 3393, 35188, 20039, 1155, 353, 8840, 836, 8, 341, 2233, 754, 66, 1669, 1281, 35190, 29838, 7936, 35308, 9254, 80786, 53, 16, 45217, 11, 220, 17, 340, 1166, 726, 1669, 609, 30570, 3872, 33066, 1860, 90, 14049, 66, 25, 7162, 66, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReflectorForWatchCache(t *testing.T) { store := newTestWatchCache(5) { _, version, err := store.WaitUntilFreshAndList(0, nil) if err != nil { t.Fatalf("unexpected error: %v", err) } if version != 0 { t.Errorf("unexpected resource version: %d", version) } } lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { fw := watch.NewFake() go fw.Stop() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}, nil }, } r := cache.NewReflector(lw, &v1.Pod{}, store, 0) r.ListAndWatch(wait.NeverStop) { _, version, err := store.WaitUntilFreshAndList(10, nil) if err != nil { t.Fatalf("unexpected error: %v", err) } if version != 10 { t.Errorf("unexpected resource version: %d", version) } } }
explode_data.jsonl/25511
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 374 }
[ 2830, 3393, 3945, 27669, 2461, 14247, 8233, 1155, 353, 8840, 836, 8, 341, 57279, 1669, 501, 2271, 14247, 8233, 7, 20, 692, 197, 515, 197, 197, 6878, 2319, 11, 1848, 1669, 3553, 28384, 24493, 55653, 3036, 852, 7, 15, 11, 2092, 340, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestJson2Struct_int(t *testing.T) { ret, err := Json2Struct("auto_name", "123", GoStructType) fmt.Printf("ret:\n %s, %v\n", ret, err) }
explode_data.jsonl/72743
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 63 }
[ 2830, 3393, 5014, 17, 9422, 4042, 1155, 353, 8840, 836, 8, 341, 11262, 11, 1848, 1669, 8308, 17, 9422, 445, 3902, 1269, 497, 330, 16, 17, 18, 497, 5994, 9422, 929, 340, 11009, 19367, 445, 2122, 7190, 77, 1018, 82, 11, 1018, 85, 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
func TestChannelsService_GetVideo(t *testing.T) { setup() defer teardown() mux.HandleFunc("/channels/ch/videos/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{"name": "Test"}`) }) video, _, err := client.Channels.GetVideo("ch", 1) if err != nil { t.Errorf("Channels.GetVideo returned unexpected error: %v", err) } want := &Video{Name: "Test"} if !reflect.DeepEqual(video, want) { t.Errorf("Channels.GetVideo returned %+v, want %+v", video, want) } }
explode_data.jsonl/49788
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 209 }
[ 2830, 3393, 35925, 1860, 13614, 10724, 1155, 353, 8840, 836, 8, 341, 84571, 741, 16867, 49304, 2822, 2109, 2200, 63623, 4283, 32425, 21284, 72945, 14, 16, 497, 2915, 3622, 1758, 37508, 11, 435, 353, 1254, 9659, 8, 341, 197, 18185, 3523,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReconcileInvalidTaskRuns(t *testing.T) { noTaskRun := tb.TaskRun("notaskrun", tb.TaskRunNamespace("foo"), tb.TaskRunSpec(tb.TaskRunTaskRef("notask"))) withWrongRef := tb.TaskRun("taskrun-with-wrong-ref", tb.TaskRunNamespace("foo"), tb.TaskRunSpec( tb.TaskRunTaskRef("taskrun-with-wrong-ref", tb.TaskRefKind(v1alpha1.ClusterTaskKind)), )) taskRuns := []*v1alpha1.TaskRun{noTaskRun, withWrongRef} tasks := []*v1alpha1.Task{simpleTask} d := test.Data{ TaskRuns: taskRuns, Tasks: tasks, } testcases := []struct { name string taskRun *v1alpha1.TaskRun reason string wantEvents []string }{{ name: "task run with no task", taskRun: noTaskRun, reason: podconvert.ReasonFailedResolution, wantEvents: []string{ "Normal Started ", "Warning Failed ", }, }, { name: "task run with wrong ref", taskRun: withWrongRef, reason: podconvert.ReasonFailedResolution, wantEvents: []string{ "Normal Started ", "Warning Failed ", }, }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { testAssets, cancel := getTaskRunController(t, d) defer cancel() c := testAssets.Controller clients := testAssets.Clients reconciler := c.Reconciler.(*Reconciler) fr := reconciler.Recorder.(*record.FakeRecorder) err := reconciler.Reconcile(context.Background(), getRunName(tc.taskRun)) // When a TaskRun is invalid and can't run, we don't want to return an error because // an error will tell the Reconciler to keep trying to reconcile; instead we want to stop // and forget about the Run. if err != nil { t.Errorf("Did not expect to see error when reconciling invalid TaskRun but saw %q", err) } // Check actions and events actions := clients.Kube.Actions() if len(actions) != 1 || actions[0].Matches("namespaces", "list") { t.Errorf("expected one action (list namespaces) created by the reconciler, got %d. Actions: %#v", len(actions), actions) } err = checkEvents(fr, tc.name, tc.wantEvents) if !(err == nil) { t.Errorf(err.Error()) } // Since the TaskRun is invalid, the status should say it has failed condition := tc.taskRun.Status.GetCondition(apis.ConditionSucceeded) if condition == nil || condition.Status != corev1.ConditionFalse { t.Errorf("Expected invalid TaskRun to have failed status, but had %v", condition) } if condition != nil && condition.Reason != tc.reason { t.Errorf("Expected failure to be because of reason %q but was %s", tc.reason, condition.Reason) } }) } }
explode_data.jsonl/879
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 979 }
[ 2830, 3393, 693, 40446, 457, 7928, 6262, 73920, 1155, 353, 8840, 836, 8, 341, 72104, 6262, 6727, 1669, 16363, 28258, 6727, 445, 1921, 1073, 6108, 497, 16363, 28258, 6727, 22699, 445, 7975, 3975, 16363, 28258, 6727, 8327, 61414, 28258, 672...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetRevisionHistoryOrDefault(t *testing.T) { revisionHistoryLimit := int32(2) rolloutNonDefaultValue := &v1alpha1.Rollout{ Spec: v1alpha1.RolloutSpec{ RevisionHistoryLimit: &revisionHistoryLimit, }, } assert.Equal(t, revisionHistoryLimit, GetRevisionHistoryLimitOrDefault(rolloutNonDefaultValue)) rolloutDefaultValue := &v1alpha1.Rollout{} assert.Equal(t, DefaultRevisionHistoryLimit, GetRevisionHistoryLimitOrDefault(rolloutDefaultValue)) }
explode_data.jsonl/15128
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 155 }
[ 2830, 3393, 1949, 33602, 13424, 14188, 1155, 353, 8840, 836, 8, 341, 197, 28342, 13424, 16527, 1669, 526, 18, 17, 7, 17, 340, 197, 1100, 411, 8121, 41533, 1669, 609, 85, 16, 7141, 16, 71212, 411, 515, 197, 7568, 992, 25, 348, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestDb_Concurrent(t *testing.T) { const n, secs, maxkey = 4, 2, 1000 runtime.GOMAXPROCS(n) trun(t, func(h *dbHarness) { var closeWg sync.WaitGroup var stop uint32 var cnt [n]uint32 for i := 0; i < n; i++ { closeWg.Add(1) go func(i int) { var put, get, found uint defer func() { t.Logf("goroutine %d stopped after %d ops, put=%d get=%d found=%d missing=%d", i, cnt[i], put, get, found, get-found) closeWg.Done() }() rnd := rand.New(rand.NewSource(int64(1000 + i))) for atomic.LoadUint32(&stop) == 0 { x := cnt[i] k := rnd.Intn(maxkey) kstr := fmt.Sprintf("%016d", k) if (rnd.Int() % 2) > 0 { put++ h.put(kstr, fmt.Sprintf("%d.%d.%-1000d", k, i, x)) } else { get++ v, err := h.db.Get([]byte(kstr), h.ro) if err == nil { found++ rk, ri, rx := 0, -1, uint32(0) fmt.Sscanf(string(v), "%d.%d.%d", &rk, &ri, &rx) if rk != k { t.Errorf("invalid key want=%d got=%d", k, rk) } if ri < 0 || ri >= n { t.Error("invalid goroutine number: ", ri) } else { tx := atomic.LoadUint32(&(cnt[ri])) if rx > tx { t.Errorf("invalid seq number, %d > %d ", rx, tx) } } } else if err != ErrNotFound { t.Error("Get: got error: ", err) return } } atomic.AddUint32(&cnt[i], 1) } }(i) } time.Sleep(secs * time.Second) atomic.StoreUint32(&stop, 1) closeWg.Wait() }) runtime.GOMAXPROCS(1) }
explode_data.jsonl/6038
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 866 }
[ 2830, 3393, 7994, 15100, 3231, 1155, 353, 8840, 836, 8, 341, 4777, 308, 11, 49749, 11, 1932, 792, 284, 220, 19, 11, 220, 17, 11, 220, 16, 15, 15, 15, 271, 7000, 4466, 1224, 1898, 2954, 9117, 6412, 1445, 340, 25583, 359, 1155, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestJdwpTransformer_IsApplicable(t *testing.T) { tests := []struct { description string source ImageConfiguration launcher string result bool }{ { description: "JAVA_TOOL_OPTIONS", source: ImageConfiguration{Env: map[string]string{"JAVA_TOOL_OPTIONS": "-agent:jdwp"}}, result: true, }, { description: "JAVA_VERSION", source: ImageConfiguration{Env: map[string]string{"JAVA_VERSION": "8"}}, result: true, }, { description: "entrypoint java", source: ImageConfiguration{Entrypoint: []string{"java", "-jar", "foo.jar"}}, result: true, }, { description: "entrypoint /usr/bin/java", source: ImageConfiguration{Entrypoint: []string{"/usr/bin/java", "-jar", "foo.jar"}}, result: true, }, { description: "no entrypoint, args java", source: ImageConfiguration{Arguments: []string{"java", "-jar", "foo.jar"}}, result: true, }, { description: "no entrypoint, arguments /usr/bin/java", source: ImageConfiguration{Arguments: []string{"/usr/bin/java", "-jar", "foo.jar"}}, result: true, }, { description: "launcher entrypoint", source: ImageConfiguration{Entrypoint: []string{"launcher"}, Arguments: []string{"/usr/bin/java", "-jar", "foo.jar"}}, launcher: "launcher", result: true, }, { description: "entrypoint /bin/sh", source: ImageConfiguration{Entrypoint: []string{"/bin/sh"}}, result: false, }, { description: "nothing", source: ImageConfiguration{}, result: false, }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&entrypointLaunchers, []string{test.launcher}) result := jdwpTransformer{}.IsApplicable(test.source) t.CheckDeepEqual(test.result, result) }) } }
explode_data.jsonl/32581
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 793 }
[ 2830, 3393, 41, 67, 8421, 46358, 31879, 2164, 46114, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 42407, 914, 198, 197, 47418, 414, 4654, 7688, 198, 197, 197, 77191, 262, 914, 198, 197, 9559, 414, 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...
1
func TestMappedPage_err(t *testing.T) { defer func() { mapFileFunc = fileutil.RWMap }() mapFileFunc = func(filePath string, size int) ([]byte, error) { return nil, fmt.Errorf("err") } mp, err := NewMappedPage(filepath.Join(t.TempDir(), t.Name()), 128) assert.Error(t, err) assert.Nil(t, mp) }
explode_data.jsonl/31829
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 129 }
[ 2830, 3393, 83345, 2665, 9266, 1155, 353, 8840, 836, 8, 341, 16867, 2915, 368, 341, 197, 19567, 1703, 9626, 284, 1034, 1314, 2013, 54, 2227, 198, 197, 66816, 19567, 1703, 9626, 284, 2915, 29605, 914, 11, 1379, 526, 8, 34923, 3782, 11,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestCheckMountPoint_Fail_Read(t *testing.T) { basepath, err := os.Getwd() if err != nil { t.Fatalf("Could not retrieve working directory: %s", err.Error()) } node, err := ioutil.TempDir(basepath, "filesystem") if err != nil { t.Fatalf("Failed to create folder: %s", err.Error()) } defer os.RemoveAll(node) options := []string{} if runtime.GOOS == "darwin" { options = append(options, "-o", "defer_permissions") } testfs := &Testfs{} host := fuse.NewFileSystemHost(testfs) go host.Mount(node, options) defer host.Unmount() time.Sleep(2 * time.Second) if err = CheckMountPoint(node); err == nil { t.Error("Function should have returned error") } }
explode_data.jsonl/18658
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 256 }
[ 2830, 3393, 3973, 16284, 2609, 1400, 604, 38381, 1155, 353, 8840, 836, 8, 341, 24195, 2343, 11, 1848, 1669, 2643, 2234, 6377, 741, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 12895, 537, 17179, 3238, 6220, 25, 1018, 82, 497, 184...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestDedup(t *testing.T) { // Arrange logger, err := zap.NewDevelopment() require.NoError(t, err, "failed to get logger") moduleChain := []string{"auth"} moduleCount := []int{1} config := getConfigWithAuthListener(t, moduleChain, moduleCount, true) mModule1 := createMockHandlerWithReturn(nil, nil) loader := loaderstest.MockLoader{} loader.On("LoadModule", "module.auth.1").Return(mModule1, nil) server, err := New(config, logger, &loader) assert.Equal(t, err, nil) isReady := server.StartAndWait() require.True(t, isReady, "failed to initialize the server") packet := radius.New(radius.CodeAccessRequest, []byte(config.Secret)) rfc2865.UserName_SetString(packet, "tim") rfc2865.UserPassword_SetString(packet, "12345") // Act (no response, package will be sent multiple times) radius.DefaultClient.Retry, _ = time.ParseDuration("10ms") deadline := time.Now().Add(time.Millisecond * 100) d, cancelFunc := context.WithDeadline(context.Background(), deadline) port := config.Listeners[0].Extra["Port"].(int) _, _ = radius.Exchange( d, packet, fmt.Sprintf(":%d", port), ) server.Stop() cancelFunc() // Assert loader.AssertExpectations(t) mModule1.AssertExpectations(t) // This ASSERT is a bit tricky; // The test is timed to take 100 millisec, retrying packet every 10ms // This timing is expected to give us 9 retries (first attempt is not // counted) however, this integration test depends on timing, so we // ease the expected count. // IF THIS ASSERT FAILS EITHER THERE'S A JITTER IN THE RADIUS CLIENT // TIMER (which is an issue by itself) OR THE RETRY LOGIC BROKE assert.True(t, server.GetDroppedCount() > 5) }
explode_data.jsonl/59975
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 576 }
[ 2830, 3393, 35, 291, 454, 1155, 353, 8840, 836, 8, 341, 197, 322, 40580, 198, 17060, 11, 1848, 1669, 32978, 7121, 39419, 741, 17957, 35699, 1155, 11, 1848, 11, 330, 16091, 311, 633, 5925, 1138, 54020, 18837, 1669, 3056, 917, 4913, 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 TestDefaultSessionManager_AddGlobalSession_RemoveGlobalSession(t *testing.T) { gs := globalSessionProvider(t) sessionManager := NewDefaultSessionManager("default") sessionManager.AddGlobalSession(gs) sessionManager.RemoveGlobalSession(gs) }
explode_data.jsonl/60392
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 67 }
[ 2830, 3393, 3675, 5283, 2043, 21346, 11646, 5283, 66843, 11646, 5283, 1155, 353, 8840, 836, 8, 341, 3174, 82, 1669, 3644, 5283, 5179, 1155, 692, 25054, 2043, 1669, 1532, 3675, 5283, 2043, 445, 2258, 1138, 25054, 2043, 1904, 11646, 5283, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPriorityModelIndeterminate(t *testing.T) { e, _ := NewEnforcer("examples/priority_model.conf", "examples/priority_indeterminate_policy.csv") testEnforce(t, e, "alice", "data1", "read", false) }
explode_data.jsonl/57138
{ "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, 20555, 1712, 1425, 64224, 1155, 353, 8840, 836, 8, 341, 7727, 11, 716, 1669, 1532, 1702, 82010, 445, 51668, 4322, 8773, 5047, 13937, 497, 330, 51668, 4322, 8773, 9122, 64224, 22773, 11219, 5130, 18185, 1702, 8833, 1155, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestUpdatePortfolio(t *testing.T) { newbase := Base{} newbase.AddAddress("someaddress", "LTC", "LTCWALLETTEST", 0.02) portfolio := GetPortfolio() portfolio.SeedPortfolio(newbase) value := portfolio.UpdatePortfolio( []string{"LdP8Qox1VAhCzLJNqrr74YovaWYyNBUWvL"}, "LTC", ) if !value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } value = portfolio.UpdatePortfolio([]string{"Testy"}, "LTC") if value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } value = portfolio.UpdatePortfolio( []string{"LdP8Qox1VAhCzLJNqrr74YovaWYyNBUWvL", "LVa8wZ983PvWtdwXZ8viK6SocMENLCXkEy"}, "LTC", ) if !value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } value = portfolio.UpdatePortfolio( []string{"LdP8Qox1VAhCzLJNqrr74YovaWYyNBUWvL", "Testy"}, "LTC", ) if value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } time.Sleep(time.Second * 5) value = portfolio.UpdatePortfolio( []string{"0xb794f5ea0ba39494ce839613fffba74279579268", "0xe853c56864a2ebe4576a807d26fdc4a0ada51919"}, "ETH", ) if !value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } value = portfolio.UpdatePortfolio( []string{"0xb794f5ea0ba39494ce839613fffba74279579268", "TESTY"}, "ETH", ) if value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } value = portfolio.UpdatePortfolio( []string{PortfolioAddressExchange, PortfolioAddressPersonal}, "LTC") if !value { t.Error("Test Failed - portfolio_test.go - UpdatePortfolio error") } }
explode_data.jsonl/33742
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 651 }
[ 2830, 3393, 4289, 66675, 1155, 353, 8840, 836, 8, 341, 8638, 3152, 1669, 5351, 16094, 8638, 3152, 1904, 4286, 445, 14689, 4995, 497, 330, 43, 7749, 497, 330, 43, 7749, 54, 969, 20756, 10033, 497, 220, 15, 13, 15, 17, 340, 197, 27159...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTenantIDs(t *testing.T) { tests := []struct { name string pjs []prowapi.ProwJob expected []string }{ { name: "no PJs", pjs: []prowapi.ProwJob{}, expected: []string{}, }, { name: "one PJ", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, }, expected: []string{"test"}, }, { name: "multiple PJs with same ID", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, }, expected: []string{"test"}, }, { name: "multiple PJs with different ID", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "other", }, }, }, }, expected: []string{"test", "other"}, }, { name: "no tenantID in prowJob", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{}, }, }, }, expected: []string{"test", ""}, }, { name: "no pjDefault in prowJob", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "test", }, }, }, { Spec: prowapi.ProwJobSpec{}, }, }, expected: []string{"test", ""}, }, { name: "multiple no tenant PJs", pjs: []prowapi.ProwJob{ { Spec: prowapi.ProwJobSpec{ ProwJobDefault: &prowapi.ProwJobDefault{ TenantID: "", }, }, }, { Spec: prowapi.ProwJobSpec{}, }, }, expected: []string{""}, }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { sp := subpool{pjs: tc.pjs} if diff := cmp.Diff(tc.expected, sp.TenantIDs(), cmpopts.SortSlices(func(x, y string) bool { return strings.Compare(x, y) > 0 })); diff != "" { t.Errorf("expected tenantIDs differ from actual: %s", diff) } }) } }
explode_data.jsonl/42804
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1336 }
[ 2830, 3393, 71252, 30466, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 257, 914, 198, 197, 3223, 2519, 414, 3056, 79, 651, 2068, 1069, 651, 12245, 198, 197, 42400, 3056, 917, 198, 197, 59403, 197, 197, 515, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestCustomToUnstructuredTopLevel(t *testing.T) { // Only objects are supported at the top level topLevelCases := []interface{}{ &CustomValue{data: []byte(`{"a":1}`)}, &CustomPointer{data: []byte(`{"a":1}`)}, } expected := map[string]interface{}{"a": int64(1)} for i, obj := range topLevelCases { obj := obj t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() result, err := runtime.NewTestUnstructuredConverter(simpleEquality).ToUnstructured(obj) require.NoError(t, err) assert.Equal(t, expected, result) }) } }
explode_data.jsonl/77966
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 239 }
[ 2830, 3393, 10268, 1249, 1806, 51143, 5366, 4449, 1155, 353, 8840, 836, 8, 972, 197, 322, 8278, 6171, 525, 7248, 518, 279, 1909, 2188, 319, 42118, 4449, 37302, 1669, 3056, 4970, 6257, 1666, 197, 197, 5, 10268, 1130, 90, 691, 25, 3056,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestOrQuery_GetGE(t *testing.T) { sl := datastruct.NewSkipList(datastruct.DefaultMaxLevel) sl.Add(document.DocId(1), [1]byte{}) sl.Add(document.DocId(3), [1]byte{}) sl.Add(document.DocId(6), [1]byte{}) sl.Add(document.DocId(10), [1]byte{}) sl1 := datastruct.NewSkipList(datastruct.DefaultMaxLevel) sl1.Add(document.DocId(1), [1]byte{}) sl1.Add(document.DocId(4), [1]byte{}) sl1.Add(document.DocId(6), [1]byte{}) sl1.Add(document.DocId(9), [1]byte{}) Convey("or query getGE (two queries)", t, func() { s1 := sl.Iterator() s2 := sl1.Iterator() a := NewOrQuery([]Query{NewTermQuery(s1), NewTermQuery(s2)}, nil) testCases := [][]document.DocId{ {1, 1}, {2, 3}, {3, 3}, {4, 4}, {5, 6}, {6, 6}, {7, 9}, {8, 9}, {9, 9}, } for _, c := range testCases { v, e := a.GetGE(c[0]) So(v, ShouldEqual, c[1]) So(e, ShouldBeNil) } v, e := a.GetGE(10) So(v, ShouldEqual, 10) So(e, ShouldBeNil) v, e = a.GetGE(11) So(v, ShouldEqual, 0) So(e, ShouldNotBeNil) }) Convey("or query getGE (one query)", t, func() { a := NewOrQuery([]Query{NewTermQuery(sl.Iterator())}, nil) v, e := a.GetGE(8) So(v, ShouldEqual, 10) So(e, ShouldBeNil) v, e = a.GetGE(2) So(v, ShouldEqual, 10) So(e, ShouldBeNil) v, e = a.GetGE(11) So(v, ShouldEqual, 0) So(e, ShouldNotBeNil) }) }
explode_data.jsonl/43260
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 689 }
[ 2830, 3393, 2195, 2859, 13614, 10777, 1155, 353, 8840, 836, 8, 341, 78626, 1669, 821, 1235, 7121, 35134, 852, 2592, 1235, 13275, 5974, 4449, 692, 78626, 1904, 15290, 42452, 764, 7, 16, 701, 508, 16, 90184, 37790, 78626, 1904, 15290, 424...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDSSNew(t *testing.T) { dssArgs := DSSArgs{secret: partSec[0], participants: partPubs, long: longterms[0], random: randoms[0], msg: msg, T: 4} dss, err := NewDSS(dssArgs) assert.NotNil(t, dss) assert.Nil(t, err) dssArgs.secret = suite.Scalar().Zero() dss, err = NewDSS(dssArgs) assert.Nil(t, dss) assert.Error(t, err) }
explode_data.jsonl/60381
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 155 }
[ 2830, 3393, 35, 1220, 3564, 1155, 353, 8840, 836, 8, 341, 2698, 778, 4117, 1669, 422, 1220, 4117, 90, 20474, 25, 949, 8430, 58, 15, 1125, 13026, 25, 949, 47, 15738, 345, 197, 17514, 25, 1293, 18347, 58, 15, 1125, 4194, 25, 4194, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestStatusActions(t *testing.T) { // make sure election can be created os.Setenv("POD_NAME", "foo1") os.Setenv("POD_NAMESPACE", apiv1.NamespaceDefault) c := Config{ Client: buildSimpleClientSet(), PublishService: "", IngressLister: buildIngressLister(), UpdateStatusOnShutdown: true, } k8s.IngressPodDetails = &k8s.PodInfo{ ObjectMeta: metav1.ObjectMeta{ Name: "foo_base_pod", Namespace: apiv1.NamespaceDefault, Labels: map[string]string{ "label_sig": "foo_pod", }, }, } // create object fkSync := NewStatusSyncer(c) if fkSync == nil { t.Fatalf("expected a valid Sync") } fk := fkSync.(statusSync) // start it and wait for the election and syn actions stopCh := make(chan struct{}) defer close(stopCh) go fk.Run(stopCh) // wait for the election time.Sleep(100 * time.Millisecond) // execute sync fk.sync("just-test") // PublishService is empty, so the running address is: ["11.0.0.2"] // after updated, the ingress's ip should only be "11.0.0.2" newIPs := []apiv1.LoadBalancerIngress{{ IP: "11.0.0.2", }} fooIngress1, err1 := fk.Client.NetworkingV1().Ingresses(apiv1.NamespaceDefault).Get(context.TODO(), "foo_ingress_1", metav1.GetOptions{}) if err1 != nil { t.Fatalf("unexpected error") } fooIngress1CurIPs := fooIngress1.Status.LoadBalancer.Ingress if !ingressSliceEqual(fooIngress1CurIPs, newIPs) { t.Fatalf("returned %v but expected %v", fooIngress1CurIPs, newIPs) } time.Sleep(1 * time.Second) // execute shutdown fk.Shutdown() // ingress should be empty newIPs2 := []apiv1.LoadBalancerIngress{} fooIngress2, err2 := fk.Client.NetworkingV1().Ingresses(apiv1.NamespaceDefault).Get(context.TODO(), "foo_ingress_1", metav1.GetOptions{}) if err2 != nil { t.Fatalf("unexpected error") } fooIngress2CurIPs := fooIngress2.Status.LoadBalancer.Ingress if !ingressSliceEqual(fooIngress2CurIPs, newIPs2) { t.Fatalf("returned %v but expected %v", fooIngress2CurIPs, newIPs2) } oic, err := fk.Client.NetworkingV1().Ingresses(metav1.NamespaceDefault).Get(context.TODO(), "foo_ingress_different_class", metav1.GetOptions{}) if err != nil { t.Fatalf("unexpected error") } if oic.Status.LoadBalancer.Ingress[0].IP != "0.0.0.0" && oic.Status.LoadBalancer.Ingress[0].Hostname != "foo.bar.com" { t.Fatalf("invalid ingress status for rule with different class") } }
explode_data.jsonl/63331
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 993 }
[ 2830, 3393, 2522, 12948, 1155, 353, 8840, 836, 8, 341, 197, 322, 1281, 2704, 6223, 646, 387, 3465, 198, 25078, 4202, 3160, 445, 2045, 35, 4708, 497, 330, 7975, 16, 1138, 25078, 4202, 3160, 445, 2045, 35, 34552, 497, 1443, 344, 16, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
func TestServeTerminals(t *testing.T) { signer, err := NewRandomSigner(1024) if err != nil { t.Fatal(err) } config := MakeNoAuth() config.AddHostKey(signer) s, err := ListenSSH("localhost:0", config) if err != nil { t.Fatal(err) } terminals := make(chan *Terminal) s.HandlerFunc = func(term *Terminal) { terminals <- term } go s.Serve() go func() { // Accept one terminal, read from it, echo back, close. term := <-terminals term.SetPrompt("> ") line, err := term.ReadLine() if err != nil { t.Error(err) } _, err = term.Write([]byte("echo: " + line + "\n")) if err != nil { t.Error(err) } term.Close() }() host := s.Addr().String() name := "foo" err = ConnectShell(host, name, func(r io.Reader, w io.WriteCloser) error { // Consume if there is anything buf := new(bytes.Buffer) w.Write([]byte("hello\r\n")) buf.Reset() _, err := io.Copy(buf, r) expected := "> hello\r\necho: hello\r\n" actual := buf.String() if actual != expected { if err != nil { t.Error(err) } t.Errorf("Got %q; expected %q", actual, expected) } s.Close() return nil }) if err != nil { t.Fatal(err) } }
explode_data.jsonl/42153
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 511 }
[ 2830, 3393, 60421, 17249, 23695, 1155, 353, 8840, 836, 8, 341, 69054, 261, 11, 1848, 1669, 1532, 13999, 7264, 261, 7, 16, 15, 17, 19, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 25873, 1669, 7405, 2753, 50...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReadAppend(t *testing.T) { var tests = []struct { in string rv bool label string value string }{ {"Label 1+=More Text", true, "Label 1", "More Text"}, {"Label 1 += More Text", true, "Label 1", "More Text"}, {"Label 1 = More Text", false, "", ""}, } for idx, tt := range tests { rv, label, value := readAppend(tt.in) if rv != tt.rv || label != tt.label || value != tt.value { t.Errorf("idx: %d, expected: %t, %q, %q, actual: %t, %q, %q", idx, tt.rv, tt.label, tt.value, rv, label, value) } } }
explode_data.jsonl/49352
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 244 }
[ 2830, 3393, 4418, 23877, 1155, 353, 8840, 836, 8, 341, 2405, 7032, 284, 3056, 1235, 341, 197, 17430, 262, 914, 198, 197, 78484, 262, 1807, 198, 197, 29277, 914, 198, 197, 16309, 914, 198, 197, 59403, 197, 197, 4913, 2476, 220, 16, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func TestBitMatrixParser_copyBit(t *testing.T) { img, _ := gozxing.NewSquareBitMatrix(21) for i := 0; i < 21; i++ { if i%2 == 0 { img.Set(i, 10) } if i%3 == 0 { img.Set(i, 11) } } p, _ := NewBitMatrixParser(img) bits := 0 bits = p.copyBit(10, 10, bits) bits = p.copyBit(11, 10, bits) bits = p.copyBit(12, 10, bits) bits = p.copyBit(13, 10, bits) if bits != 10 { t.Fatalf("bits = %v, expect 10", bits) } p.SetMirror(true) bits = 0 bits = p.copyBit(10, 6, bits) bits = p.copyBit(11, 6, bits) bits = p.copyBit(12, 6, bits) bits = p.copyBit(13, 6, bits) if bits != 12 { t.Fatalf("bits = %v, expect 12", bits) } }
explode_data.jsonl/32238
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 313 }
[ 2830, 3393, 8344, 6689, 6570, 16096, 8344, 1155, 353, 8840, 836, 8, 341, 39162, 11, 716, 1669, 728, 66700, 287, 7121, 33271, 8344, 6689, 7, 17, 16, 340, 2023, 600, 1669, 220, 15, 26, 600, 366, 220, 17, 16, 26, 600, 1027, 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...
6
func TestBarcodeProp_MakeValid(t *testing.T) { cases := []struct { name string barcodeProp props.Barcode assert func(t *testing.T, prop props.Barcode) }{ { "When percent is less than zero, should become 100", props.Barcode{ Percent: -2, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Percent, 100.0) }, }, { "When percent is greater than 100, should become 100", props.Barcode{ Percent: 102, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Percent, 100.0) }, }, { "When is center, top and left should become 0", props.Barcode{ Center: true, Top: 5, Left: 5, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Top, 0.0) assert.Equal(t, prop.Left, 0.0) }, }, { "When left is less than 0, should become 0", props.Barcode{ Left: -5, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Left, 0.0) }, }, { "When top is less than 0, should become 0", props.Barcode{ Top: -5, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Top, 0.0) }, }, { "When proportion.width less than 0", props.Barcode{ Proportion: props.Proportion{ Width: -5, }, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Proportion.Width, 1.0) }, }, { "When proportion.height less than 0", props.Barcode{ Proportion: props.Proportion{ Height: -5, }, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Proportion.Height, 0.20) }, }, { "When height is smaller than 10% of width", props.Barcode{ Proportion: props.Proportion{ Width: 11, Height: 1, }, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Proportion.Height, prop.Proportion.Width*0.10) }, }, { "When height is grather than 20% of width", props.Barcode{ Proportion: props.Proportion{ Width: 5, Height: 5, }, }, func(t *testing.T, prop props.Barcode) { assert.Equal(t, prop.Proportion.Height, prop.Proportion.Width*0.20) }, }, } for _, c := range cases { c.barcodeProp.MakeValid() c.assert(t, c.barcodeProp) } }
explode_data.jsonl/68876
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1137 }
[ 2830, 3393, 83206, 2008, 1245, 726, 4088, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 90709, 1851, 2008, 6914, 40520, 1851, 198, 197, 6948, 414, 2915, 1155, 353, 8840, 836, 11, 2004...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestList(t *testing.T) { kind := "List" item, err := api.Scheme.New(api.SchemeGroupVersion.WithKind(kind)) if err != nil { t.Errorf("Couldn't make a %v? %v", kind, err) return } roundTripSame(t, testapi.Default, item) }
explode_data.jsonl/47652
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 98 }
[ 2830, 3393, 852, 1155, 353, 8840, 836, 8, 341, 197, 15314, 1669, 330, 852, 698, 22339, 11, 1848, 1669, 6330, 92719, 7121, 24827, 92719, 2808, 5637, 26124, 10629, 62697, 1171, 743, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 38987, 944,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTaskRunSpec_SetDefaults(t *testing.T) { cases := []struct { desc string trs *v1alpha1.TaskRunSpec want *v1alpha1.TaskRunSpec }{{ desc: "taskref is nil", trs: &v1alpha1.TaskRunSpec{ TaskRef: nil, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, want: &v1alpha1.TaskRunSpec{ TaskRef: nil, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, }, { desc: "taskref kind is empty", trs: &v1alpha1.TaskRunSpec{ TaskRef: &v1alpha1.TaskRef{}, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, want: &v1alpha1.TaskRunSpec{ TaskRef: &v1alpha1.TaskRef{Kind: v1alpha1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, }, { desc: "timeout is nil", trs: &v1alpha1.TaskRunSpec{ TaskRef: &v1alpha1.TaskRef{Kind: v1alpha1.ClusterTaskKind}, }, want: &v1alpha1.TaskRunSpec{ TaskRef: &v1alpha1.TaskRef{Kind: v1alpha1.ClusterTaskKind}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "pod template is nil", trs: &v1alpha1.TaskRunSpec{}, want: &v1alpha1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "pod template is not nil", trs: &v1alpha1.TaskRunSpec{ PodTemplate: &v1alpha1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, }, }, want: &v1alpha1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, PodTemplate: &v1alpha1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, }, }, }, { desc: "embedded taskSpec", trs: &v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{ Inputs: &v1alpha1.Inputs{ Params: []v1alpha1.ParamSpec{{ Name: "param-name", }}, }, }, }, want: &v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{ Inputs: &v1alpha1.Inputs{ Params: []v1alpha1.ParamSpec{{ Name: "param-name", Type: v1alpha1.ParamTypeString, }}, }, }, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }} for _, tc := range cases { t.Run(tc.desc, func(t *testing.T) { ctx := context.Background() tc.trs.SetDefaults(ctx) if d := cmp.Diff(tc.want, tc.trs); d != "" { t.Errorf("Mismatch of TaskRunSpec %s", diff.PrintWantGot(d)) } }) } }
explode_data.jsonl/50987
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1118 }
[ 2830, 3393, 6262, 6727, 8327, 14812, 16273, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 41653, 914, 198, 197, 25583, 82, 220, 353, 85, 16, 7141, 16, 28258, 6727, 8327, 198, 197, 50780, 353, 85, 16, 7141, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func TestCustomTypeAsArray(t *testing.T) { var jsonTypedData = ` { "types": { "EIP712Domain": [ { "name": "name", "type": "string" }, { "name": "version", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" } ], "Person": [ { "name": "name", "type": "string" }, { "name": "wallet", "type": "address" } ], "Person[]": [ { "name": "baz", "type": "string" } ], "Mail": [ { "name": "from", "type": "Person" }, { "name": "to", "type": "Person[]" }, { "name": "contents", "type": "string" } ] }, "primaryType": "Mail", "domain": { "name": "Ether Mail", "version": "1", "chainId": 1, "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" }, "message": { "from": { "name": "Cow", "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" }, "to": {"baz": "foo"}, "contents": "Hello, Bob!" } } ` var malformedTypedData core.TypedData err := json.Unmarshal([]byte(jsonTypedData), &malformedTypedData) if err != nil { t.Fatalf("unmarshalling failed '%v'", err) } _, err = malformedTypedData.HashStruct("EIP712Domain", malformedTypedData.Domain.Map()) if err != nil { t.Errorf("Expected no error, got '%v'", err) } }
explode_data.jsonl/30006
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1025 }
[ 2830, 3393, 10268, 929, 2121, 1857, 1155, 353, 8840, 836, 8, 341, 2405, 2951, 44466, 1043, 284, 22074, 262, 341, 414, 330, 9242, 788, 341, 286, 330, 36, 3298, 22, 16, 17, 13636, 788, 2278, 688, 341, 310, 330, 606, 788, 330, 606, 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...
3
func TestConnectedRanExecuteSetupSuccess(t *testing.T) { _, rmrMessengerMock, readerMock, writerMock, ranReconnectionManager, _ := initRanLostConnectionTest(t) origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_ENDC_X2_SETUP_REQUEST} var rnibErr error readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr) updatedNodebInfo := *origNodebInfo updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTING updatedNodebInfo.ConnectionAttempts++ writerMock.On("UpdateNodebInfo", &updatedNodebInfo).Return(nil) rmrMessengerMock.On("SendMsg", mock.Anything, true).Return(&rmrCgo.MBuf{}, nil) err := ranReconnectionManager.ReconnectRan(ranName) assert.Nil(t, err) readerMock.AssertCalled(t, "GetNodeb", ranName) writerMock.AssertNumberOfCalls(t, "UpdateNodebInfo", 1) rmrMessengerMock.AssertNumberOfCalls(t, "SendMsg", 1) }
explode_data.jsonl/42903
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 378 }
[ 2830, 3393, 21146, 49, 276, 17174, 21821, 7188, 1155, 353, 8840, 836, 8, 341, 197, 6878, 18998, 81, 87626, 11571, 11, 6604, 11571, 11, 6916, 11571, 11, 10613, 693, 7742, 2043, 11, 716, 1669, 2930, 49, 276, 47253, 4526, 2271, 1155, 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
func TestAbsCollection_Sort(t *testing.T) { intColl := NewIntCollection([]int{2, 4, 3}) intColl2 := intColl.Sort() if intColl2.Err() != nil { t.Fatal(intColl2.Err()) } ins, err := intColl2.ToInts() if err != nil { t.Fatal(err) } if ins[1] != 3 || ins[0] != 2 { t.Fatal("sort error") } }
explode_data.jsonl/66457
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 141 }
[ 2830, 3393, 27778, 6482, 1098, 371, 1155, 353, 8840, 836, 8, 341, 2084, 15265, 1669, 1532, 1072, 6482, 10556, 396, 90, 17, 11, 220, 19, 11, 220, 18, 3518, 2084, 15265, 17, 1669, 526, 15265, 35976, 741, 743, 526, 15265, 17, 27862, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
func Test_Workspace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() parameters.MaxSize = 10 properties := gopter.NewProperties(parameters) properties.Property( "Round trip from Workspace to hub returns original", prop.ForAll(RunResourceConversionTestForWorkspace, WorkspaceGenerator())) properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) }
explode_data.jsonl/43357
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 141 }
[ 2830, 3393, 87471, 8746, 62, 4498, 61941, 1249, 19316, 2568, 795, 21884, 1690, 26040, 39838, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 67543, 1669, 728, 73137, 13275, 2271, 9706, 741, 67543, 14535, 1695, 284, 220, 16, 15, 19...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestRootRoute(t *testing.T) { setupDataFileForTest() router := setupAPI() w := httptest.NewRecorder() req, _ := http.NewRequest("GET", "/", nil) router.ServeHTTP(w, req) if w.Code != 200 { t.Errorf("Response was incorrect, got: %d, want: 200.", w.Code) } }
explode_data.jsonl/81907
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 109 }
[ 2830, 3393, 8439, 4899, 1155, 353, 8840, 836, 8, 341, 84571, 1043, 1703, 2461, 2271, 741, 67009, 1669, 6505, 7082, 2822, 6692, 1669, 54320, 70334, 7121, 47023, 741, 24395, 11, 716, 1669, 1758, 75274, 445, 3806, 497, 64657, 2092, 340, 67...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClassifierInclude(t *testing.T) { prog := classificationProg classifier := &programClassifier{ Includes: packageFilters([]packageFilter{ {Name: "github.com/michalq/go-swagger/fixtures/goparsing/classification"}, {Name: "github.com/michalq/go-swagger/fixtures/goparsing/classification/transitive/mods"}, {Name: "github.com/michalq/go-swagger/fixtures/goparsing/classification/operations"}, {Name: "github.com/michalq/go-swagger/fixtures/goparsing/classification/operations_annotation"}, }), } classified, err := classifier.Classify(prog) assert.NoError(t, err) // ensure all the dependencies are there assert.Len(t, classified.Meta, 1) assert.Len(t, classified.Routes, 1) //var fNames []string //for _, file := range classified.Models { //fNames = append( //fNames, //filepath.Base(prog.Fset.File(file.Pos()).Name())) //} //sort.Sort(sort.StringSlice(fNames)) //assert.EqualValues(t, []string{"pet.go"}, fNames) }
explode_data.jsonl/65955
{ "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, 33895, 22283, 1155, 353, 8840, 836, 8, 1476, 197, 32992, 1669, 23850, 89535, 198, 15487, 3049, 1669, 609, 14906, 33895, 515, 197, 197, 55834, 25, 6328, 28351, 10556, 1722, 5632, 515, 298, 197, 63121, 25, 330, 5204, 905, 3183...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAttemptSecured(t *testing.T) { b := AttemptSecured("http://some.url", true) if b { t.Fatal("trying to attempt non secured with http:// but got true") } b = AttemptSecured("http://some.url", false) if b { t.Fatal("trying to attempt non secured with http:// but got true") } b = AttemptSecured("grpc://some.url", true) if b { t.Fatal("trying to attempt non secured with grpc:// but got true") } b = AttemptSecured("grpc://some.url", false) if b { t.Fatal("trying to attempt secured with grpc:// but got true") } b = AttemptSecured("grpcs://some.url", true) if !b { t.Fatal("trying to attempt non secured with grpcs://, but got false") } b = AttemptSecured("grpcs://some.url", false) if !b { t.Fatal("trying to attempt secured with grpcs://, but got false") } b = AttemptSecured("some.url", true) if b { t.Fatal("trying to attempt non secured with no protocol in url, but got true") } b = AttemptSecured("some.url", false) if !b { t.Fatal("trying to attempt secured with no protocol in url, but got false") } }
explode_data.jsonl/78487
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 391 }
[ 2830, 3393, 47052, 8430, 3073, 1155, 353, 8840, 836, 8, 341, 2233, 1669, 43517, 8430, 3073, 445, 1254, 1110, 14689, 7315, 497, 830, 340, 743, 293, 341, 197, 3244, 26133, 445, 84034, 311, 4774, 2477, 26430, 448, 1758, 1110, 714, 2684, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetListElementsWithSet(t *testing.T) { assert := assert.New(t) vs := newTestValueStore() v := types.NewSet(vs, types.Number(0), types.Number(1), types.Number(2)) r := getListElements(vs, v, map[string]interface{}{}) assert.Equal([]interface{}{float64(0), float64(1), float64(2)}, r) r = getListElements(vs, v, map[string]interface{}{ atKey: 1, }) assert.Equal([]interface{}{float64(1), float64(2)}, r) r = getListElements(vs, v, map[string]interface{}{ countKey: 2, }) assert.Equal([]interface{}{float64(0), float64(1)}, r) }
explode_data.jsonl/17731
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 226 }
[ 2830, 3393, 1949, 852, 11868, 2354, 1649, 1155, 353, 8840, 836, 8, 341, 6948, 1669, 2060, 7121, 1155, 340, 5195, 82, 1669, 501, 2271, 1130, 6093, 741, 5195, 1669, 4494, 7121, 1649, 78182, 11, 4494, 31182, 7, 15, 701, 4494, 31182, 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...
1
func TestGetConfig(t *testing.T) { Setup() team := &model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN} team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team) user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) store.Must(Srv.Store.User().VerifyEmail(user.Id)) Client.LoginByEmail(team.Name, user.Email, "pwd") if _, err := Client.GetConfig(); err == nil { t.Fatal("Shouldn't have permissions") } c := &Context{} c.RequestId = model.NewId() c.IpAddress = "cmd_line" UpdateRoles(c, user, model.ROLE_SYSTEM_ADMIN) Client.LoginByEmail(team.Name, user.Email, "pwd") if result, err := Client.GetConfig(); err != nil { t.Fatal(err) } else { cfg := result.Data.(*model.Config) if len(cfg.TeamSettings.SiteName) == 0 { t.Fatal() } } }
explode_data.jsonl/26002
{ "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, 1949, 2648, 1155, 353, 8840, 836, 8, 341, 197, 21821, 2822, 197, 9196, 1669, 609, 2528, 65842, 90, 26456, 25, 330, 675, 497, 3988, 25, 330, 89, 9141, 27651, 488, 1614, 7121, 764, 368, 488, 330, 64, 497, 8299, 25, 330, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAsteriscParamter(t *testing.T) { router := MakeRouter() router.GET("/:*", fw) router.GET("/hello", printHello) RunRequest(router, "GET", "/", 200, "Got: ", t) RunRequest(router, "GET", "/1234", 200, "Got: /1234", t) RunRequest(router, "GET", "/hello", 200, "hello", t) }
explode_data.jsonl/15104
{ "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, 32, 3667, 3427, 2001, 465, 1155, 353, 8840, 836, 8, 341, 67009, 1669, 7405, 9523, 741, 67009, 17410, 4283, 53386, 497, 33886, 340, 67009, 17410, 4283, 14990, 497, 1173, 9707, 692, 85952, 1900, 61210, 11, 330, 3806, 497, 6465...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDelete(t *testing.T) { tests := []struct { name string key func(int) interface{} }{ {name: "int", key: func(i int) interface{} { return i }}, {name: "string", key: func(i int) interface{} { return strconv.Itoa(i) }}, {name: "[]byte", key: func(i int) interface{} { return []byte(strconv.Itoa(i) + "bytes") }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { m := &HashMap{} m.Del(tt.key(0)) elephant := &Animal{"elephant"} monkey := &Animal{"monkey"} m.Set(tt.key(1), elephant) m.Set(tt.key(2), monkey) m.Del(tt.key(0)) m.Del(tt.key(3)) if m.Len() != 2 { t.Error("map should contain exactly two elements.") } m.Del(tt.key(1)) m.Del(tt.key(1)) m.Del(tt.key(2)) if m.Len() != 0 { t.Error("map should be empty.") } quit := make(chan struct{}) for item := range m.Iter(quit) { t.Errorf("map should be empty but got %v in the iterator.", item) } val, ok := m.Get(tt.key(1)) // Get a missing element. if ok { t.Error("ok should be false when item is missing from map.") } if val != nil { t.Error("Missing values should return as nil.") } m.Set(tt.key(1), elephant) }) } }
explode_data.jsonl/24430
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 548 }
[ 2830, 3393, 6435, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 914, 198, 197, 23634, 220, 2915, 1548, 8, 3749, 16094, 197, 59403, 197, 197, 47006, 25, 330, 396, 497, 1376, 25, 2915, 1956, 526, 8, 3749, 625...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCopyBundleWithCollocatedReferencedImagesToRepoWithLockOutput(t *testing.T) { env := BuildEnv(t) imgpkg := Imgpkg{t, Logger{}, env.ImgpkgPath} assetsPath := filepath.Join("assets", "simple-app") // force digest to change so test is meaningful randFile, err := addRandomFile(assetsPath) if err != nil { t.Fatalf("failed to create unuique file: %v", err) } defer os.Remove(randFile) out := imgpkg.Run([]string{"push", "--tty", "-i", env.Image, "-f", assetsPath}) imageDigest := fmt.Sprintf("@%s", extractDigest(out, t)) imgsYml := fmt.Sprintf(`--- apiVersion: imgpkg.carvel.dev/v1alpha1 kind: ImagesLock spec: images: - image: %s%s `, env.Image, imageDigest) // create a bundle with ref to generic imgpkgDir, err := createBundleDir(assetsPath, bundleYAML, imgsYml) if err != nil { t.Fatalf("failed to create bundle dir: %v", err) } defer os.RemoveAll(imgpkgDir) // create bundle that refs image and a random tag based on time bundleTag := fmt.Sprintf(":%d", time.Now().UnixNano()) out = imgpkg.Run([]string{"push", "--tty", "-b", fmt.Sprintf("%s%s", env.Image, bundleTag), "-f", assetsPath}) bundleDigest := fmt.Sprintf("@%s", extractDigest(out, t)) lockOutputPath := filepath.Join(os.TempDir(), "bundle-relocate-lock.yml") defer os.Remove(lockOutputPath) // copy via created ref imgpkg.Run([]string{"copy", "--bundle", fmt.Sprintf("%s%s", env.Image, bundleTag), "--to-repo", env.RelocationRepo, "--lock-output", lockOutputPath}, ) bLockBytes, err := ioutil.ReadFile(lockOutputPath) if err != nil { t.Fatalf("could not read lock-output: %v", err) } var bLock cmd.BundleLock err = yaml.Unmarshal(bLockBytes, &bLock) if err != nil { t.Fatalf("could not unmarshal lock output: %v", err) } expectedRef := fmt.Sprintf("%s%s", env.RelocationRepo, bundleDigest) if bLock.Spec.Image.DigestRef != expectedRef { t.Fatalf("expected lock output to contain relocated ref '%s', got '%s'", expectedRef, bLock.Spec.Image.DigestRef) } if trimmedTag := strings.TrimPrefix(bundleTag, ":"); bLock.Spec.Image.OriginalTag != trimmedTag { t.Fatalf("expected lock output to contain tag '%s', got '%s'", trimmedTag, bLock.Spec.Image.OriginalTag) } if err := validateBundleLockApiVersionAndKind(bLock); err != nil { t.Fatal(err.Error()) } refs := []string{env.RelocationRepo + imageDigest, env.RelocationRepo + bundleTag, env.RelocationRepo + bundleDigest} if err := validateImagePresence(refs); err != nil { t.Fatalf("could not validate image presence: %v", err) } }
explode_data.jsonl/23214
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 948 }
[ 2830, 3393, 12106, 8409, 2354, 6127, 39463, 47447, 5767, 14228, 1249, 25243, 2354, 11989, 5097, 1155, 353, 8840, 836, 8, 341, 57538, 1669, 7854, 14359, 1155, 340, 39162, 30069, 1669, 2362, 21888, 7351, 90, 83, 11, 9514, 22655, 6105, 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...
9
func TestWeakMarshalNil(t *testing.T) { if !flags.ProtoLegacy { t.SkipNow() } m := new(testpb.TestWeak) m.SetWeakMessage1(nil) if b, err := proto.Marshal(m); err != nil || len(b) != 0 { t.Errorf("Marshal(weak field set to nil) = [%x], %v; want [], nil", b, err) } m.SetWeakMessage1((*weakpb.WeakImportMessage1)(nil)) if b, err := proto.Marshal(m); err != nil || len(b) != 0 { t.Errorf("Marshal(weak field set to typed nil) = [%x], %v; want [], nil", b, err) } }
explode_data.jsonl/44801
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 207 }
[ 2830, 3393, 49649, 55438, 19064, 1155, 353, 8840, 836, 8, 341, 743, 753, 11161, 7763, 983, 77415, 341, 197, 3244, 57776, 7039, 741, 197, 630, 2109, 1669, 501, 8623, 16650, 8787, 49649, 340, 2109, 4202, 49649, 2052, 16, 27907, 340, 743, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func TestBug3486(t *testing.T) { // https://golang.org/issue/3486 if runtime.GOOS == "darwin" { switch runtime.GOARCH { case "arm", "arm64": t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH) } } root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test") if err != nil { t.Fatal(err) } bugs := filepath.Join(root, "fixedbugs") ken := filepath.Join(root, "ken") seenBugs := false seenKen := false err = filepath.Walk(root, func(pth string, info os.FileInfo, err error) error { if err != nil { t.Fatal(err) } switch pth { case bugs: seenBugs = true return filepath.SkipDir case ken: if !seenBugs { t.Fatal("filepath.Walk out of order - ken before fixedbugs") } seenKen = true } return nil }) if err != nil { t.Fatal(err) } if !seenKen { t.Fatalf("%q not seen", ken) } }
explode_data.jsonl/1673
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 378 }
[ 2830, 3393, 46773, 18, 19, 23, 21, 1155, 353, 8840, 836, 8, 314, 442, 3703, 1110, 70, 37287, 2659, 14, 11159, 14, 18, 19, 23, 21, 198, 743, 15592, 97574, 3126, 621, 330, 98765, 1, 341, 197, 8961, 15592, 97574, 10790, 341, 197, 272...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestVariables_NullableScalars_AllowsNullableInputsToBeSetToAValueInAVariable(t *testing.T) { doc := ` query SetsNullable($value: String) { fieldWithNullableStringInput(input: $value) } ` params := map[string]interface{}{ "value": "a", } expected := &graphql.Result{ Data: map[string]interface{}{ "fieldWithNullableStringInput": `"a"`, }, } ast := testutil.TestParse(t, doc) // execute ep := graphql.ExecuteParams{ Schema: variablesTestSchema, AST: ast, Args: params, } result := testutil.TestExecute(t, ep) if len(result.Errors) > 0 { t.Fatalf("wrong result, unexpected errors: %v", result.Errors) } if !reflect.DeepEqual(expected, result) { t.Fatalf("Unexpected result, Diff: %v", testutil.Diff(expected, result)) } }
explode_data.jsonl/6445
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 317 }
[ 2830, 3393, 22678, 55534, 480, 54005, 53629, 4241, 15703, 31946, 1249, 3430, 1649, 1249, 32, 1130, 641, 32, 7827, 1155, 353, 8840, 836, 8, 341, 59536, 1669, 22074, 414, 3239, 12525, 15703, 699, 957, 25, 923, 8, 341, 286, 2070, 2354, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestParseTimeout(t *testing.T) { t.Parallel() tests := []struct { name string timeout string timeoutFunc func(url.Values) (time.Duration, error) result time.Duration err error }{ { name: "SkynetTimeout/Default", timeout: "", timeoutFunc: parseTimeout, result: DefaultSkynetRequestTimeout, err: nil, }, { name: "SkynetTimeout/Zero", timeout: "0", timeoutFunc: parseTimeout, result: 0, err: errZeroTimeout, }, { name: "SkynetTimeout/Max", timeout: fmt.Sprint(MaxSkynetRequestTimeout.Seconds()), timeoutFunc: parseTimeout, result: MaxSkynetRequestTimeout, err: nil, }, { name: "SkynetTimeout/AboveMax", timeout: fmt.Sprint(MaxSkynetRequestTimeout.Seconds() + 1), timeoutFunc: parseTimeout, result: 0, err: errTimeoutTooHigh, }, { name: "RegistryTimeout/Default", timeout: "", timeoutFunc: parseRegistryTimeout, result: renter.DefaultRegistryHealthTimeout, err: nil, }, { name: "RegistryTimeout/Zero", timeout: "0", timeoutFunc: parseRegistryTimeout, result: 0, err: errZeroTimeout, }, { name: "RegistryTimeout/Max", timeout: fmt.Sprint(renter.MaxRegistryReadTimeout.Seconds()), timeoutFunc: parseRegistryTimeout, result: renter.MaxRegistryReadTimeout, err: nil, }, { name: "RegistryTimeout/AboveMax", timeout: fmt.Sprint(renter.MaxRegistryReadTimeout.Seconds() + 1), timeoutFunc: parseRegistryTimeout, result: 0, err: errTimeoutTooHigh, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { values := url.Values{} values.Set("timeout", test.timeout) d, err := test.timeoutFunc(values) if test.err != nil && !errors.Contains(err, test.err) { t.Fatal(err) } if test.err == nil && err != nil { t.Fatal(err) } if d != test.result { t.Fatalf("%v != %v", d, test.result) } }) } }
explode_data.jsonl/67181
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 953 }
[ 2830, 3393, 14463, 7636, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 78216, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 78395, 257, 914, 198, 197, 78395, 9626, 2915, 6522, 35145, 8, 320, 1678, 33795, 11, 1465, 69...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestVTGateSplitQueryUnsharded(t *testing.T) { keyspace := KsTestUnsharded createSandbox(keyspace) hcVTGateTest.Reset() hcVTGateTest.AddTestTablet("aa", "1.1.1.1", 1001, keyspace, "0", topodatapb.TabletType_RDONLY, true, 1, nil) sql := "select col1, col2 from table" bindVars := map[string]interface{}{"bv1": nil} splitColumns := []string{"sc1", "sc2"} algorithm := querypb.SplitQueryRequest_FULL_SCAN type testCaseType struct { splitCount int64 numRowsPerQueryPart int64 } testCases := []testCaseType{ {splitCount: 100, numRowsPerQueryPart: 0}, {splitCount: 0, numRowsPerQueryPart: 123}, } for _, testCase := range testCases { splits, err := rpcVTGate.SplitQuery( context.Background(), keyspace, sql, bindVars, splitColumns, testCase.splitCount, testCase.numRowsPerQueryPart, algorithm) if err != nil { t.Errorf("got %v, want: nil. testCase: %+v", err, testCase) } // Total number of splits should be number of shards (1) as our sandbox returns a single split // for its fake implementation of SplitQuery. if 1 != len(splits) { t.Errorf("wrong number of splits, got %+v, want %+v. testCase:\n%+v", len(splits), 1, testCase) continue } split := splits[0] if split.KeyRangePart != nil { t.Errorf("KeyRangePart should not be populated. Got:\n%+v\n, testCase:\n%+v\n", keyspace, split.KeyRangePart) } if split.ShardPart.Keyspace != keyspace { t.Errorf("wrong keyspace, got \n%+v, want \n%+v. testCase:\n%+v", keyspace, split.ShardPart.Keyspace, testCase) } if len(split.ShardPart.Shards) != 1 { t.Errorf("wrong number of shards, got \n%+v, want \n%+v. testCase:\n%+v", 1, len(split.ShardPart.Shards), testCase) } expectedShard := "0" expectedSQL := fmt.Sprintf( "query:%v, splitColumns:%v, splitCount:%v,"+ " numRowsPerQueryPart:%v, algorithm:%v, shard:%v", querytypes.BoundQuery{Sql: sql, BindVariables: bindVars}, splitColumns, testCase.splitCount, testCase.numRowsPerQueryPart, algorithm, expectedShard, ) if split.Query.Sql != expectedSQL { t.Errorf("got:\n%v\n, want:\n%v\n, testCase:\n%+v", split.Query.Sql, expectedSQL, testCase) } } }
explode_data.jsonl/7842
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 946 }
[ 2830, 3393, 20457, 42318, 20193, 2859, 1806, 927, 20958, 1155, 353, 8840, 836, 8, 341, 23634, 8746, 1669, 730, 82, 2271, 1806, 927, 20958, 198, 39263, 50, 31536, 4857, 8746, 340, 9598, 66, 20457, 42318, 2271, 36660, 741, 9598, 66, 20457...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestVerAckWire( t *testing.T) { msgVerAck := NewMsgVerAck() msgVerAckEncoded := []byte{} tests := []struct { in *MsgVerAck // Message to encode out *MsgVerAck // Expected decoded message buf []byte // Wire encoding pver uint32 // Protocol version for wire encoding enc MessageEncoding // Message encoding format }{ // Latest protocol version. { msgVerAck, msgVerAck, msgVerAckEncoded, ProtocolVersion, BaseEncoding, }, // Protocol version BIP0035Version. { msgVerAck, msgVerAck, msgVerAckEncoded, BIP0035Version, BaseEncoding, }, // Protocol version BIP0031Version. { msgVerAck, msgVerAck, msgVerAckEncoded, BIP0031Version, BaseEncoding, }, // Protocol version NetAddressTimeVersion. { msgVerAck, msgVerAck, msgVerAckEncoded, NetAddressTimeVersion, BaseEncoding, }, // Protocol version MultipleAddressVersion. { msgVerAck, msgVerAck, msgVerAckEncoded, MultipleAddressVersion, BaseEncoding, }, } t.Logf("Running %d tests", len(tests)) for i, test := range tests { // Encode the message to wire format. var buf bytes.Buffer err := test.in.BtcEncode(&buf, test.pver, test.enc) if err != nil { t.Errorf("BtcEncode #%d error %v", i, err) continue } if !bytes.Equal(buf.Bytes(), test.buf) { t.Errorf("BtcEncode #%d\n got: %s want: %s", i, spew.Sdump(buf.Bytes()), spew.Sdump(test.buf)) continue } // Decode the message from wire format. var msg MsgVerAck rbuf := bytes.NewReader(test.buf) err = msg.BtcDecode(rbuf, test.pver, test.enc) if err != nil { t.Errorf("BtcDecode #%d error %v", i, err) continue } if !reflect.DeepEqual(&msg, test.out) { t.Errorf("BtcDecode #%d\n got: %s want: %s", i, spew.Sdump(msg), spew.Sdump(test.out)) continue } } }
explode_data.jsonl/55344
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 849 }
[ 2830, 3393, 10141, 55559, 37845, 1006, 3244, 353, 8840, 836, 8, 1476, 21169, 10141, 55559, 1669, 1532, 6611, 10141, 55559, 741, 21169, 10141, 55559, 46795, 1669, 3056, 3782, 16094, 78216, 1669, 3056, 1235, 341, 197, 17430, 256, 353, 6611, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCheckIngress(t *testing.T) { defer func() { filepath.Walk(os.TempDir(), func(path string, info os.FileInfo, err error) error { if info.IsDir() && os.TempDir() != path { return filepath.SkipDir } if strings.HasPrefix(info.Name(), tempNginxPattern) { os.Remove(path) } return nil }) }() err := file.CreateRequiredDirectories() if err != nil { t.Fatal(err) } // Ensure no panic with wrong arguments var nginx *NGINXController nginx.CheckIngress(nil) nginx = newNGINXController(t) nginx.CheckIngress(nil) nginx.metricCollector = metric.DummyCollector{} nginx.t = fakeTemplate{} nginx.store = fakeIngressStore{ ingresses: []*ingress.Ingress{}, } ing := &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: "test-ingress", Namespace: "user-namespace", Annotations: map[string]string{}, }, Spec: networking.IngressSpec{ Rules: []networking.IngressRule{ { Host: "example.com", }, }, }, } t.Run("When the ingress class differs from nginx", func(t *testing.T) { ing.ObjectMeta.Annotations["kubernetes.io/ingress.class"] = "different" nginx.command = testNginxTestCommand{ t: t, err: fmt.Errorf("test error"), } if nginx.CheckIngress(ing) != nil { t.Errorf("with a different ingress class, no error should be returned") } }) t.Run("when the class is the nginx one", func(t *testing.T) { ing.ObjectMeta.Annotations["kubernetes.io/ingress.class"] = "nginx" nginx.command = testNginxTestCommand{ t: t, err: nil, expected: "_,example.com", } if nginx.CheckIngress(ing) != nil { t.Errorf("with a new ingress without error, no error should be returned") } t.Run("When the hostname is updated", func(t *testing.T) { nginx.store = fakeIngressStore{ ingresses: []*ingress.Ingress{ { Ingress: *ing, ParsedAnnotations: &annotations.Ingress{}, }, }, } ing.Spec.Rules[0].Host = "test.example.com" nginx.command = testNginxTestCommand{ t: t, err: nil, expected: "_,test.example.com", } if nginx.CheckIngress(ing) != nil { t.Errorf("with a new ingress without error, no error should be returned") } }) t.Run("When nginx test returns an error", func(t *testing.T) { nginx.command = testNginxTestCommand{ t: t, err: fmt.Errorf("test error"), out: []byte("this is the test command output"), expected: "_,test.example.com", } if nginx.CheckIngress(ing) == nil { t.Errorf("with a new ingress with an error, an error should be returned") } }) t.Run("When the ingress is in a different namespace than the watched one", func(t *testing.T) { nginx.command = testNginxTestCommand{ t: t, err: fmt.Errorf("test error"), } nginx.cfg.Namespace = "other-namespace" ing.ObjectMeta.Namespace = "test-namespace" if nginx.CheckIngress(ing) != nil { t.Errorf("with a new ingress without error, no error should be returned") } }) }) }
explode_data.jsonl/69681
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1302 }
[ 2830, 3393, 3973, 641, 2483, 1155, 353, 8840, 836, 8, 341, 16867, 2915, 368, 341, 197, 17661, 2343, 1175, 1692, 9638, 65009, 6184, 1507, 2915, 5581, 914, 11, 3546, 2643, 8576, 1731, 11, 1848, 1465, 8, 1465, 341, 298, 743, 3546, 4506, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCreateOrganization3(t *testing.T) { // create org with same name as existent org assert.NoError(t, PrepareTestDatabase()) owner := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) org := &User{Name: "user3"} // should already exist AssertExistsAndLoadBean(t, &User{Name: org.Name}) // sanity check err := CreateOrganization(org, owner) assert.Error(t, err) assert.True(t, IsErrUserAlreadyExist(err)) CheckConsistencyFor(t, &User{}, &Team{}) }
explode_data.jsonl/71056
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 189 }
[ 2830, 3393, 4021, 41574, 18, 1155, 353, 8840, 836, 8, 341, 197, 322, 1855, 1240, 448, 1852, 829, 438, 3000, 306, 1240, 198, 6948, 35699, 1155, 11, 31166, 2271, 5988, 12367, 197, 8118, 1669, 5319, 15575, 3036, 5879, 10437, 1155, 11, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestResourceRecordSetsRemoveGone(t *testing.T) { zone := firstZone(t) sets := rrs(t, zone) rrset := getExampleRrs(zone) addRrsetOrFail(t, sets, rrset) err := sets.StartChangeset().Remove(rrset).Apply() if err != nil { // Try again to clean up. defer sets.StartChangeset().Remove(rrset).Apply() t.Errorf("Failed to remove resource record set %v after adding", rrset) } else { t.Logf("Successfully removed resource set %v after adding", rrset) } record := getRrOrFail(t, sets, rrset.Name()) if record != nil { t.Errorf("Deleted resource record set %v is still present", rrset) } }
explode_data.jsonl/75415
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 227 }
[ 2830, 3393, 4783, 6471, 30175, 13021, 38, 603, 1155, 353, 8840, 836, 8, 341, 197, 8684, 1669, 1156, 15363, 1155, 340, 197, 4917, 1669, 435, 5428, 1155, 11, 10143, 340, 197, 634, 746, 1669, 633, 13314, 49, 5428, 74228, 340, 12718, 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...
3
func TestStateOutputVoteStats(t *testing.T) { cs, vss := randState(2) // create dummy peer peer := p2pmock.NewPeer(nil) vote := signVote(vss[1], types.PrecommitType, []byte("test"), types.PartSetHeader{}) voteMessage := &VoteMessage{vote} cs.handleMsg(msgInfo{voteMessage, peer.ID()}) statsMessage := <-cs.statsMsgQueue require.Equal(t, voteMessage, statsMessage.Msg, "") require.Equal(t, peer.ID(), statsMessage.PeerID, "") // sending the same part from different peer cs.handleMsg(msgInfo{&VoteMessage{vote}, "peer2"}) // sending the vote for the bigger height incrementHeight(vss[1]) vote = signVote(vss[1], types.PrecommitType, []byte("test"), types.PartSetHeader{}) cs.handleMsg(msgInfo{&VoteMessage{vote}, peer.ID()}) select { case <-cs.statsMsgQueue: t.Errorf("should not output stats message after receiving the known vote or vote from bigger height") case <-time.After(50 * time.Millisecond): } }
explode_data.jsonl/81666
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 321 }
[ 2830, 3393, 1397, 5097, 41412, 16635, 1155, 353, 8840, 836, 8, 341, 71899, 11, 348, 778, 1669, 10382, 1397, 7, 17, 340, 197, 322, 1855, 17292, 14397, 198, 197, 16537, 1669, 281, 17, 5187, 1176, 7121, 30888, 27907, 692, 5195, 1272, 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...
3
func TestBundlerWithEmptyRootInfo(t *testing.T) { b := newBundlerWithoutRootsAndInters(t) // "force" bundle should be ok bundle, err := b.BundleFromPEMorDER(GoDaddyIntermediateCert, nil, Force, "") if err != nil { t.Fatal(err) } checkBundleFunc := ExpectBundleLength(1) checkBundleFunc(t, bundle) // force non-verifying bundle should fail. _, err = b.BundleFromFile(badBundle, "", Force, "") if err == nil { t.Fatal("expected error. but no error occurred") } checkErrorFunc := ExpectErrorMessage("\"code\":1200") checkErrorFunc(t, err) // "optimal" and "ubiquitous" bundle should be ok bundle, err = b.BundleFromPEMorDER(GoDaddyIntermediateCert, nil, Ubiquitous, "") if err != nil { t.Fatal(err) } checkBundleFunc = ExpectBundleLength(1) checkBundleFunc(t, bundle) bundle, err = b.BundleFromPEMorDER(GoDaddyIntermediateCert, nil, Optimal, "") if err != nil { t.Fatal(err) } checkBundleFunc = ExpectBundleLength(1) checkBundleFunc(t, bundle) // bundle remote should be ok bundle, err = b.BundleFromRemote("www.google.com", "", Ubiquitous) if err != nil { t.Fatal(err) } checkBundleFunc = ExpectBundleLength(2) checkBundleFunc(t, bundle) }
explode_data.jsonl/36892
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 463 }
[ 2830, 3393, 33, 85365, 2354, 3522, 8439, 1731, 1155, 353, 8840, 836, 8, 341, 2233, 1669, 501, 33, 85365, 26040, 8439, 82, 3036, 1072, 388, 1155, 692, 197, 322, 330, 8833, 1, 12894, 1265, 387, 5394, 198, 2233, 4206, 11, 1848, 1669, 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...
6
func TestTxExecutorPrepareRedoFail(t *testing.T) { txe, tsv, db := newTestTxExecutor(t) defer db.Close() defer tsv.StopService() txid := newTxForPrep(tsv) err := txe.Prepare(txid, "bb") defer txe.RollbackPrepared("bb", 0) require.Error(t, err) require.Contains(t, err.Error(), "is not supported") }
explode_data.jsonl/25164
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 129 }
[ 2830, 3393, 31584, 25255, 50590, 6033, 78, 19524, 1155, 353, 8840, 836, 8, 341, 3244, 8371, 11, 259, 3492, 11, 2927, 1669, 501, 2271, 31584, 25255, 1155, 340, 16867, 2927, 10421, 741, 16867, 259, 3492, 30213, 1860, 741, 46237, 307, 1669...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestStatsChangeProcessor(t *testing.T) { ctx := context.Background() processor := &StatsChangeProcessor{} // Created assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeAccount, Pre: nil, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeClaimableBalance, Pre: nil, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeData, Pre: nil, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeOffer, Pre: nil, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeTrustline, Pre: nil, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeLiquidityPool, Pre: nil, Post: &xdr.LedgerEntry{}, })) // Updated assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeAccount, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeClaimableBalance, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeData, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeOffer, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeTrustline, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeLiquidityPool, Pre: &xdr.LedgerEntry{}, Post: &xdr.LedgerEntry{}, })) // Removed assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeAccount, Pre: &xdr.LedgerEntry{}, Post: nil, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeClaimableBalance, Pre: &xdr.LedgerEntry{}, Post: nil, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeData, Pre: &xdr.LedgerEntry{}, Post: nil, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeOffer, Pre: &xdr.LedgerEntry{}, Post: nil, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeTrustline, Pre: &xdr.LedgerEntry{}, Post: nil, })) assert.NoError(t, processor.ProcessChange(ctx, Change{ Type: xdr.LedgerEntryTypeLiquidityPool, Pre: &xdr.LedgerEntry{}, Post: nil, })) results := processor.GetResults() assert.Equal(t, int64(1), results.AccountsCreated) assert.Equal(t, int64(1), results.ClaimableBalancesCreated) assert.Equal(t, int64(1), results.DataCreated) assert.Equal(t, int64(1), results.OffersCreated) assert.Equal(t, int64(1), results.TrustLinesCreated) assert.Equal(t, int64(1), results.LiquidityPoolsCreated) assert.Equal(t, int64(1), results.AccountsUpdated) assert.Equal(t, int64(1), results.ClaimableBalancesUpdated) assert.Equal(t, int64(1), results.DataUpdated) assert.Equal(t, int64(1), results.OffersUpdated) assert.Equal(t, int64(1), results.TrustLinesUpdated) assert.Equal(t, int64(1), results.LiquidityPoolsUpdated) assert.Equal(t, int64(1), results.AccountsRemoved) assert.Equal(t, int64(1), results.ClaimableBalancesRemoved) assert.Equal(t, int64(1), results.DataRemoved) assert.Equal(t, int64(1), results.OffersRemoved) assert.Equal(t, int64(1), results.TrustLinesRemoved) assert.Equal(t, int64(1), results.LiquidityPoolsRemoved) }
explode_data.jsonl/62248
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1532 }
[ 2830, 3393, 16635, 4072, 22946, 1155, 353, 8840, 836, 8, 341, 20985, 1669, 2266, 19047, 741, 197, 29474, 1669, 609, 16635, 4072, 22946, 31483, 197, 322, 4290, 198, 6948, 35699, 1155, 11, 17654, 29012, 4072, 7502, 11, 10388, 515, 197, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestArray_PopLeft(t *testing.T) { gtest.C(t, func(t *gtest.T) { array := garray.NewFrom(g.Slice{1, 2, 3}) v, ok := array.PopLeft() t.Assert(v, 1) t.Assert(ok, true) t.Assert(array.Len(), 2) v, ok = array.PopLeft() t.Assert(v, 2) t.Assert(ok, true) t.Assert(array.Len(), 1) v, ok = array.PopLeft() t.Assert(v, 3) t.Assert(ok, true) t.Assert(array.Len(), 0) }) }
explode_data.jsonl/13893
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 210 }
[ 2830, 3393, 1857, 1088, 453, 5415, 1155, 353, 8840, 836, 8, 341, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 11923, 1669, 342, 1653, 7121, 3830, 3268, 95495, 90, 16, 11, 220, 17, 11, 220, 18, 3518, 197, 51...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_Slice(t *testing.T) { c := []int{1, 2, 3, 4, 5} iter := NewIter(c) cnt := 0 keySum := 0 valSum := 0 k := 0 v := 0 for iter.Next() { Key(iter, &k) Value(iter, &v) keySum += k valSum += v cnt++ } if cnt != 5 || keySum != 10 || valSum != 15 { t.Fail() } }
explode_data.jsonl/52932
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 148 }
[ 2830, 3393, 1098, 4754, 1155, 353, 8840, 836, 8, 341, 1444, 1669, 3056, 396, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 532, 79924, 1669, 1532, 8537, 1337, 340, 60553, 1669, 220, 15, 198, 23634, 9190, 1669, 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...
5
func TestUserAuth(t *testing.T) { res := user.Auth("email", "xiang@iqka.com", "A123456p+") assert.True(t, res.Has("user")) assert.True(t, res.Has("token")) assert.True(t, res.Has("expires_at")) assert.Panics(t, func() { user.Auth("email", "xiang@iqka.com", "A123456p+22") }) res = user.Auth("mobile", "13900001111", "U123456p+") assert.True(t, res.Has("user")) assert.True(t, res.Has("token")) assert.True(t, res.Has("expires_at")) assert.Panics(t, func() { user.Auth("email", "1390000111", "A123456p+22") }) }
explode_data.jsonl/81924
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 231 }
[ 2830, 3393, 1474, 5087, 1155, 353, 8840, 836, 8, 1476, 10202, 1669, 1196, 25233, 445, 2332, 497, 330, 11665, 524, 31, 23740, 4554, 905, 497, 330, 32, 16, 17, 18, 19, 20, 21, 79, 10, 1138, 6948, 32443, 1155, 11, 592, 16152, 445, 87...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_swapPairs(t *testing.T) { head := &ListNode{ 1, &ListNode{ 2, &ListNode{ 3, &ListNode{ 4, nil, }, }, }, } assert.Equal(t, []int{2, 1, 4, 3}, swapPairs(head).ToSlice()) }
explode_data.jsonl/25051
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 131 }
[ 2830, 3393, 40991, 54228, 1155, 353, 8840, 836, 8, 341, 46081, 1669, 609, 58707, 515, 197, 197, 16, 345, 197, 197, 5, 58707, 515, 298, 197, 17, 345, 298, 197, 5, 58707, 515, 571, 197, 18, 345, 571, 197, 5, 58707, 515, 464, 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 TestHandlerFlushHandler(t *testing.T) { store := oauth2.NewFositeMemoryStore(nil, lifespan) h := &oauth2.Handler{ H: herodot.NewJSONWriter(nil), ScopeStrategy: fosite.HierarchicScopeStrategy, IssuerURL: "http://hydra.localhost", Storage: store, } for _, r := range flushRequests { require.NoError(t, store.CreateAccessTokenSession(nil, r.ID, r)) } r := httprouter.New() h.SetRoutes(r, r) ts := httptest.NewServer(r) c := hydra.NewOAuth2ApiWithBasePath(ts.URL) ds := new(fosite.DefaultSession) ctx := context.Background() resp, err := c.FlushInactiveOAuth2Tokens(hydra.FlushInactiveOAuth2TokensRequest{NotAfter: time.Now().Add(-time.Hour * 24)}) require.NoError(t, err) assert.EqualValues(t, http.StatusNoContent, resp.StatusCode) _, err = store.GetAccessTokenSession(ctx, "flush-1", ds) require.NoError(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-2", ds) require.NoError(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-3", ds) require.NoError(t, err) resp, err = c.FlushInactiveOAuth2Tokens(hydra.FlushInactiveOAuth2TokensRequest{NotAfter: time.Now().Add(-(lifespan + time.Hour/2))}) require.NoError(t, err) assert.EqualValues(t, http.StatusNoContent, resp.StatusCode) _, err = store.GetAccessTokenSession(ctx, "flush-1", ds) require.NoError(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-2", ds) require.NoError(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-3", ds) require.Error(t, err) resp, err = c.FlushInactiveOAuth2Tokens(hydra.FlushInactiveOAuth2TokensRequest{NotAfter: time.Now()}) require.NoError(t, err) assert.EqualValues(t, http.StatusNoContent, resp.StatusCode) _, err = store.GetAccessTokenSession(ctx, "flush-1", ds) require.NoError(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-2", ds) require.Error(t, err) _, err = store.GetAccessTokenSession(ctx, "flush-3", ds) require.Error(t, err) }
explode_data.jsonl/25994
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 774 }
[ 2830, 3393, 3050, 46874, 3050, 1155, 353, 8840, 836, 8, 341, 57279, 1669, 46415, 17, 7121, 37, 87742, 10642, 6093, 27907, 11, 60861, 340, 9598, 1669, 609, 34363, 17, 31010, 515, 197, 13292, 25, 1797, 1059, 347, 354, 7121, 5370, 6492, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetDepositAddress(t *testing.T) { _, err := b.GetDepositAddress(currency.BTC, "") if err == nil { t.Error("Test Failed - GetDepositAddress() error cannot be nil") } }
explode_data.jsonl/49013
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 65 }
[ 2830, 3393, 1949, 78982, 4286, 1155, 353, 8840, 836, 8, 341, 197, 6878, 1848, 1669, 293, 2234, 78982, 4286, 90475, 1785, 7749, 11, 14676, 743, 1848, 621, 2092, 341, 197, 3244, 6141, 445, 2271, 21379, 481, 2126, 78982, 4286, 368, 1465, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
func TestStatefulSetLabelingAndAnnotations(t *testing.T) { labels := map[string]string{ "testlabel": "testlabelvalue", } annotations := map[string]string{ "testannotation": "testannotationvalue", "kubectl.kubernetes.io/last-applied-configuration": "something", "kubectl.kubernetes.io/something": "something", } // kubectl annotations must not be on the statefulset so kubectl does // not manage the generated object expectedStatefulSetAnnotations := map[string]string{ "prometheus-operator-input-hash": "", "testannotation": "testannotationvalue", } expectedStatefulSetLabels := map[string]string{ "testlabel": "testlabelvalue", } expectedPodLabels := map[string]string{ "alertmanager": "", "app": "alertmanager", "app.kubernetes.io/name": "alertmanager", "app.kubernetes.io/version": strings.TrimPrefix(operator.DefaultAlertmanagerVersion, "v"), "app.kubernetes.io/managed-by": "prometheus-operator", "app.kubernetes.io/instance": "", } sset, err := makeStatefulSet(&monitoringv1.Alertmanager{ ObjectMeta: metav1.ObjectMeta{ Labels: labels, Annotations: annotations, }, }, defaultTestConfig, "") require.NoError(t, err) if !reflect.DeepEqual(expectedStatefulSetLabels, sset.Labels) { t.Log(pretty.Compare(expectedStatefulSetLabels, sset.Labels)) t.Fatal("Labels are not properly being propagated to the StatefulSet") } if !reflect.DeepEqual(expectedStatefulSetAnnotations, sset.Annotations) { t.Log(pretty.Compare(expectedStatefulSetAnnotations, sset.Annotations)) t.Fatal("Annotations are not properly being propagated to the StatefulSet") } if !reflect.DeepEqual(expectedPodLabels, sset.Spec.Template.ObjectMeta.Labels) { t.Log(pretty.Compare(expectedPodLabels, sset.Spec.Template.ObjectMeta.Labels)) t.Fatal("Labels are not properly being propagated to the Pod") } }
explode_data.jsonl/25236
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 747 }
[ 2830, 3393, 1397, 1262, 1649, 2476, 287, 3036, 21418, 1155, 353, 8840, 836, 8, 341, 95143, 1669, 2415, 14032, 30953, 515, 197, 197, 1, 1944, 1502, 788, 330, 1944, 1502, 957, 756, 197, 532, 197, 39626, 1669, 2415, 14032, 30953, 515, 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...
4
func TestReadError(t *testing.T) { tw := NewTwitter(logger.NewLogger("test")) m := getTestMetadata() err := tw.Init(m) assert.Nilf(t, err, "error initializing valid metadata properties") tw.Read(func(res *bindings.ReadResponse) error { t.Logf("result: %+v", res) assert.NotNilf(t, err, "no error on read with invalid credentials") return nil }) }
explode_data.jsonl/21298
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 134 }
[ 2830, 3393, 4418, 1454, 1155, 353, 8840, 836, 8, 341, 3244, 86, 1669, 1532, 24862, 37833, 7121, 7395, 445, 1944, 5455, 2109, 1669, 633, 2271, 14610, 741, 9859, 1669, 4384, 26849, 1255, 340, 6948, 59678, 69, 1155, 11, 1848, 11, 330, 84...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDeployerDefault(t *testing.T) { tests := []struct { name string in *Deployer want *Deployer }{{ name: "empty", in: &Deployer{}, want: &Deployer{ Spec: DeployerSpec{ Template: &corev1.PodSpec{ Containers: []corev1.Container{ {}, }, }, IngressPolicy: IngressPolicyExternal, }, }, }} for _, test := range tests { t.Run(test.name, func(t *testing.T) { got := test.in got.Default() if diff := cmp.Diff(test.want, got); diff != "" { t.Errorf("Default (-want, +got) = %v", diff) } }) } }
explode_data.jsonl/5184
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 269 }
[ 2830, 3393, 69464, 261, 3675, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 914, 198, 197, 17430, 256, 353, 69464, 261, 198, 197, 50780, 353, 69464, 261, 198, 197, 15170, 515, 197, 11609, 25, 330, 3194, 756, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestProvisioningWithReconciler_HappyPath(t *testing.T) { // given suite := NewBrokerSuiteTest(t) defer suite.TearDown() iid := uuid.New().String() // when resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid), `{ "service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", "plan_id": "5cb3d976-b85c-42ea-a636-79cadda109a9", "context": { "sm_platform_credentials": { "url": "https://sm.url", "credentials": {} }, "globalaccount_id": "g-account-id", "subaccount_id": "sub-id", "user_id": "john.smith@email.com" }, "parameters": { "name": "testing-cluster" } }`) opID := suite.DecodeOperationID(resp) suite.processReconcilingByOperationID(opID) // then suite.AssertProvider("aws") suite.AssertProvisionRuntimeInputWithoutKymaConfig() suite.AssertClusterMetadata(opID, reconciler.Metadata{ GlobalAccountID: "g-account-id", SubAccountID: "sub-id", ServiceID: "47c9dcbf-ff30-448e-ab36-d3bad66ba281", ServicePlanID: "5cb3d976-b85c-42ea-a636-79cadda109a9", ShootName: suite.ShootName(opID), InstanceID: iid, }) suite.AssertClusterKymaConfig(opID, reconciler.KymaConfig{ Version: "2.0", Profile: "Production", Administrators: []string{"john.smith@email.com"}, Components: []reconciler.Components{ { Component: "service-catalog2", Namespace: "kyma-system", Configuration: []reconciler.Configuration{ { Key: "global.domainName", Value: fmt.Sprintf("%s.kyma.sap.com", suite.ShootName(opID)), Secret: false, }, { Key: "setting-one", Value: "1234", Secret: false, }, }, }, }, }) suite.AssertClusterConfigWithKubeconfig(opID) }
explode_data.jsonl/25516
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 892 }
[ 2830, 3393, 1336, 13013, 287, 2354, 693, 40446, 5769, 2039, 11144, 1820, 1155, 353, 8840, 836, 8, 341, 197, 322, 2661, 198, 96572, 1669, 1532, 65545, 28000, 2271, 1155, 340, 16867, 16182, 836, 682, 4454, 741, 8230, 307, 1669, 16040, 712...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTxSimulatorMissingPvtdata(t *testing.T) { testEnv := testEnvsMap[levelDBtestEnvName] testEnv.init(t, "TestTxSimulatorUnsupportedTxQueries", nil) defer testEnv.cleanup() txMgr := testEnv.getTxMgr() populateCollConfigForTest(t, txMgr.(*LockBasedTxMgr), []collConfigkey{ {"ns1", "coll1"}, {"ns1", "coll2"}, {"ns1", "coll3"}, {"ns1", "coll4"}, }, version.NewHeight(1, 1), ) db := testEnv.getVDB() updateBatch := privacyenabledstate.NewUpdateBatch() updateBatch.HashUpdates.Put("ns1", "coll1", util.ComputeStringHash("key1"), util.ComputeStringHash("value1"), version.NewHeight(1, 1)) updateBatch.PvtUpdates.Put("ns1", "coll1", "key1", []byte("value1"), version.NewHeight(1, 1)) db.ApplyPrivacyAwareUpdates(updateBatch, version.NewHeight(1, 1)) assert.True(t, testPvtValueEqual(t, txMgr, "ns1", "coll1", "key1", []byte("value1"))) updateBatch = privacyenabledstate.NewUpdateBatch() updateBatch.HashUpdates.Put("ns1", "coll1", util.ComputeStringHash("key1"), util.ComputeStringHash("value1"), version.NewHeight(2, 1)) updateBatch.HashUpdates.Put("ns1", "coll2", util.ComputeStringHash("key2"), util.ComputeStringHash("value2"), version.NewHeight(2, 1)) updateBatch.HashUpdates.Put("ns1", "coll3", util.ComputeStringHash("key3"), util.ComputeStringHash("value3"), version.NewHeight(2, 1)) updateBatch.PvtUpdates.Put("ns1", "coll3", "key3", []byte("value3"), version.NewHeight(2, 1)) db.ApplyPrivacyAwareUpdates(updateBatch, version.NewHeight(2, 1)) assert.False(t, testPvtKeyExist(t, txMgr, "ns1", "coll1", "key1")) assert.False(t, testPvtKeyExist(t, txMgr, "ns1", "coll2", "key2")) assert.True(t, testPvtValueEqual(t, txMgr, "ns1", "coll3", "key3", []byte("value3"))) assert.True(t, testPvtValueEqual(t, txMgr, "ns1", "coll4", "key4", nil)) }
explode_data.jsonl/63619
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 724 }
[ 2830, 3393, 31584, 14027, 10511, 25080, 47, 9708, 691, 1155, 353, 8840, 836, 8, 341, 18185, 14359, 1669, 1273, 1702, 11562, 2227, 64586, 3506, 1944, 14359, 675, 921, 18185, 14359, 8271, 1155, 11, 330, 2271, 31584, 14027, 10511, 41884, 315...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetEnvVarsFromDC(t *testing.T) { tests := []struct { name string dcName string projectName string returnedDC appsv1.DeploymentConfig returnedEnvVars []corev1.EnvVar wantErr bool }{ { name: "case 1: with valid existing dc and one valid env var pair", dcName: "nodejs-app", projectName: "project", returnedDC: appsv1.DeploymentConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "nodejs-app", }, Spec: appsv1.DeploymentConfigSpec{ Template: &corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Env: []corev1.EnvVar{ { Name: "key", Value: "value", }, }, }, }, }, }, }, }, returnedEnvVars: []corev1.EnvVar{ { Name: "key", Value: "value", }, }, wantErr: false, }, { name: "case 2: with valid existing dc and two valid env var pairs", dcName: "nodejs-app", projectName: "project", returnedDC: appsv1.DeploymentConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "nodejs-app", }, Spec: appsv1.DeploymentConfigSpec{ Template: &corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Env: []corev1.EnvVar{ { Name: "key", Value: "value", }, { Name: "key-1", Value: "value-1", }, }, }, }, }, }, }, }, returnedEnvVars: []corev1.EnvVar{ { Name: "key", Value: "value", }, { Name: "key-1", Value: "value-1", }, }, wantErr: false, }, { name: "case 3: with non valid existing dc", dcName: "nodejs-app", projectName: "project", returnedDC: appsv1.DeploymentConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "wildfly-app", }, Spec: appsv1.DeploymentConfigSpec{ Template: &corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Env: []corev1.EnvVar{}, }, }, }, }, }, }, returnedEnvVars: []corev1.EnvVar{}, wantErr: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { fakeClient, fakeClientSet := FakeNew() fakeClientSet.AppsClientset.PrependReactor("get", "deploymentconfigs", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) { dcName := action.(ktesting.GetAction).GetName() if dcName != tt.dcName { return true, nil, fmt.Errorf("get dc called with different name, expected: %s, got %s", tt.dcName, dcName) } return true, &tt.returnedDC, nil }) envVars, err := fakeClient.GetEnvVarsFromDC(tt.dcName) if err == nil && !tt.wantErr { // Check for validating actions performed if len(fakeClientSet.AppsClientset.Actions()) != 1 { t.Errorf("expected 1 action in GetBuildConfigFromName got: %v", fakeClientSet.AppsClientset.Actions()) } if !reflect.DeepEqual(tt.returnedEnvVars, envVars) { t.Errorf("env vars are not matching with expected values, expected: %s, got %s", tt.returnedEnvVars, envVars) } } else if err == nil && tt.wantErr { t.Error("error was expected, but no error was returned") } else if err != nil && !tt.wantErr { t.Errorf("test failed, no error was expected, but got unexpected error: %s", err) } }) } }
explode_data.jsonl/65177
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1804 }
[ 2830, 3393, 1949, 14359, 28305, 3830, 5626, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 310, 914, 198, 197, 87249, 675, 688, 914, 198, 197, 72470, 675, 257, 914, 198, 197, 853, 291, 5626, 414, 906, 3492, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAwsVpc1AzStorage2diskOnly(t *testing.T) { logger.Log(t, "Testcase-1: Create a Spectrum Scale storage cluster with dual disks in a new vpc with 1AZ") expectedName := fmt.Sprintf("spectrum-scale-%s", strings.ToLower(random.UniqueId())) region := terraaws.GetRandomStableRegion(t, nil, nil) azs := terraaws.GetAvailabilityZones(t, region) keyPair := terraaws.CreateAndImportEC2KeyPair(t, region, expectedName) testdir, testdirerr := os.Getwd() if testdirerr != nil { panic(testdirerr) } privateKeyPath := path.Join(testdir, expectedName) err := ioutil.WriteFile(privateKeyPath, []byte(keyPair.PrivateKey), 0600) if err != nil { panic(err) } log.Printf("Key saved to: %s", privateKeyPath) rhelownerID := "309956199498" rhelImageSearch := "RHEL-8.4.0_HVM-*x86_64-*-Hourly2-GP2" session, err := session.NewSession(&aws.Config{Region: aws.String(region)}) if err != nil { panic(err) } svc := ec2.New(session) input := &ec2.DescribeImagesInput{ Filters: []*ec2.Filter{ { Name: aws.String("name"), Values: []*string{aws.String(rhelImageSearch)}, }, { Name: aws.String("state"), Values: []*string{aws.String("available")}, }, { Name: aws.String("virtualization-type"), Values: []*string{aws.String("hvm")}, }, }, Owners: []*string{aws.String(rhelownerID)}, } result, err := svc.DescribeImages(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } log.Printf("Identified image id: %s", aws.StringValue(result.Images[0].ImageId)) terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ TerraformDir: "../../aws_scale_templates/aws_new_vpc_scale", Vars: map[string]interface{}{ "vpc_region": region, "vpc_availability_zones": []string{azs[0]}, "resource_prefix": "spectrum-scale", "bastion_key_pair": keyPair.Name, "bastion_ssh_private_key": privateKeyPath, "compute_cluster_key_pair": keyPair.Name, "storage_cluster_key_pair": keyPair.Name, "compute_cluster_image_id": aws.StringValue(result.Images[0].ImageId), "compute_cluster_gui_username": "admin", "compute_cluster_gui_password": "Passw0rd", "total_compute_cluster_instances": 0, "ebs_block_devices_per_storage_instance": 2, "storage_cluster_image_id": aws.StringValue(result.Images[0].ImageId), "storage_cluster_gui_username": "admin", "storage_cluster_gui_password": "Passw0rd", "operator_email": "sasikanth.eda@in.ibm.com", }, }) terraform.InitAndApply(t, terraformOptions) defer terraform.Destroy(t, terraformOptions) terraaws.DeleteEC2KeyPair(t, keyPair) keyerr := os.Remove(privateKeyPath) if keyerr != nil { panic(keyerr) } actualBastionPrivateIP := terraform.OutputList(t, terraformOptions, "bastion_instance_private_ip") actualBastionPublicIP := terraform.OutputList(t, terraformOptions, "bastion_instance_public_ip") actualBastionSecuritygrpID := terraform.Output(t, terraformOptions, "bastion_security_group_id") actualVpcID := terraform.Output(t, terraformOptions, "vpc_id") actualVpcPublicSubnets := terraform.OutputList(t, terraformOptions, "vpc_public_subnets") actualVpcStoragePrivateSubnets := terraform.OutputList(t, terraformOptions, "vpc_storage_cluster_private_subnets") actualVpcComputePrivateSubnets := terraform.OutputList(t, terraformOptions, "vpc_compute_cluster_private_subnets") actualComputeClusterID := terraform.OutputList(t, terraformOptions, "compute_cluster_instance_ids") actualComputeClusterIP := terraform.OutputList(t, terraformOptions, "compute_cluster_instance_private_ips") actualStorageClusterDescID := terraform.OutputList(t, terraformOptions, "storage_cluster_desc_instance_ids") actualStorageClusterDescIP := terraform.OutputList(t, terraformOptions, "storage_cluster_desc_instance_private_ips") actualStorageClusterDescMap := terraform.OutputMap(t, terraformOptions, "storage_cluster_desc_data_volume_mapping") actualStorageClusterID := terraform.OutputList(t, terraformOptions, "storage_cluster_instance_ids") actualStorageClusterIP := terraform.OutputList(t, terraformOptions, "storage_cluster_instance_private_ips") actualStorageClusterMap := terraform.OutputMap(t, terraformOptions, "storage_cluster_with_data_volume_mapping") keys := make([]string, 0, len(actualStorageClusterMap)) for k := range actualStorageClusterMap { keys = append(keys, k) } assert.Equal(t, 1, len(actualBastionPrivateIP)) assert.Equal(t, 1, len(actualBastionPublicIP)) assert.Contains(t, actualBastionSecuritygrpID, "sg-") assert.Contains(t, actualVpcID, "vpc-") assert.Equal(t, 1, len(actualVpcPublicSubnets)) assert.Equal(t, 1, len(actualVpcStoragePrivateSubnets)) assert.Equal(t, 1, len(actualVpcComputePrivateSubnets)) assert.Equal(t, 0, len(actualComputeClusterID)) assert.Equal(t, 0, len(actualComputeClusterIP)) assert.Equal(t, 0, len(actualStorageClusterDescID)) assert.Equal(t, 0, len(actualStorageClusterDescIP)) assert.Equal(t, map[string]string{}, actualStorageClusterDescMap) assert.Equal(t, 4, len(actualStorageClusterID)) assert.Equal(t, 4, len(actualStorageClusterIP)) assert.Equal(t, 4, len(actualStorageClusterMap)) assert.Equal(t, "[/dev/xvdf]", actualStorageClusterMap[keys[0]]) assert.Equal(t, 1, len([]string{actualStorageClusterMap[keys[0]]})) }
explode_data.jsonl/13456
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 2344 }
[ 2830, 3393, 47359, 53, 3992, 16, 37199, 5793, 17, 30496, 7308, 1155, 353, 8840, 836, 8, 341, 17060, 5247, 1155, 11, 330, 2271, 5638, 12, 16, 25, 4230, 264, 51839, 24613, 5819, 10652, 448, 18579, 53758, 304, 264, 501, 348, 3992, 448, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
8
func TestBarAssetsAfterRender(t *testing.T) { bar := NewBar() err := bar.Render(ioutil.Discard) assert.NoError(t, err) assert.Equal(t, []string{host + "echarts.min.js"}, bar.JSAssets.Values) }
explode_data.jsonl/28523
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 81 }
[ 2830, 3393, 3428, 26879, 6025, 6750, 1155, 353, 8840, 836, 8, 341, 90709, 1669, 1532, 3428, 741, 9859, 1669, 3619, 27386, 1956, 30158, 909, 47560, 340, 6948, 35699, 1155, 11, 1848, 340, 6948, 12808, 1155, 11, 3056, 917, 90, 3790, 488, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestConfigTxContext_DeleteAdmin(t *testing.T) { t.Skip("Delete admin is a config update, TODO in issue: https://github.com/hyperledger-labs/orion-server/issues/148") clientCryptoDir := testutils.GenerateTestClientCrypto(t, []string{"admin", "admin2", "admin3", "server"}) testServer, _, _, err := SetupTestServer(t, clientCryptoDir) defer func() { if testServer != nil { _ = testServer.Stop() } }() require.NoError(t, err) StartTestServer(t, testServer) serverPort, err := testServer.Port() require.NoError(t, err) adminCert, _ := testutils.LoadTestClientCrypto(t, clientCryptoDir, "admin") admin := &types.Admin{Id: "admin", Certificate: adminCert.Raw} admin2Cert, _ := testutils.LoadTestClientCrypto(t, clientCryptoDir, "admin2") admin3Cert, _ := testutils.LoadTestClientCrypto(t, clientCryptoDir, "admin3") admin2 := &types.Admin{Id: "admin2", Certificate: admin2Cert.Raw} admin3 := &types.Admin{Id: "admin3", Certificate: admin3Cert.Raw} bcdb := createDBInstance(t, clientCryptoDir, serverPort) session1 := openUserSession(t, bcdb, "admin", clientCryptoDir) // Add admin2 & admin3 tx1, err := session1.ConfigTx() require.NoError(t, err) require.NotNil(t, tx1) err = tx1.AddAdmin(admin2) require.NoError(t, err) err = tx1.AddAdmin(admin3) require.NoError(t, err) txID, receipt, err := tx1.Commit(true) require.NoError(t, err) require.NotNil(t, txID) require.NotNil(t, receipt) tx, err := session1.ConfigTx() require.NoError(t, err) clusterConfig, err := tx.GetClusterConfig() require.NoError(t, err) require.NotNil(t, clusterConfig) require.Len(t, clusterConfig.Admins, 3) // Remove an admin session2 := openUserSession(t, bcdb, "admin2", clientCryptoDir) tx2, err := session2.ConfigTx() require.NoError(t, err) err = tx2.DeleteAdmin(admin.Id) require.NoError(t, err) err = tx2.DeleteAdmin(admin.Id) require.EqualError(t, err, "admin does not exist in pending config: admin") err = tx2.DeleteAdmin("non-admin") require.EqualError(t, err, "admin does not exist in current config: non-admin") txID, receipt, err = tx2.Commit(true) require.NoError(t, err) require.NotNil(t, txID) require.NotNil(t, receipt) // verify tx was successfully committed tx3, err := session2.ConfigTx() require.NoError(t, err) clusterConfig, err = tx3.GetClusterConfig() require.NoError(t, err) require.NotNil(t, clusterConfig) require.Len(t, clusterConfig.Admins, 2) found, index := AdminExists("admin2", clusterConfig.Admins) require.True(t, found) require.EqualValues(t, clusterConfig.Admins[index].Certificate, admin2Cert.Raw) found, index = AdminExists("admin3", clusterConfig.Admins) require.True(t, found) require.EqualValues(t, clusterConfig.Admins[index].Certificate, admin3Cert.Raw) // session1 by removed admin cannot execute additional transactions tx4, err := session1.ConfigTx() require.EqualError(t, err, "error handling request, server returned: status: 401 Unauthorized, message: signature verification failed") require.Nil(t, tx4) }
explode_data.jsonl/65328
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1089 }
[ 2830, 3393, 2648, 31584, 1972, 57418, 7210, 1155, 353, 8840, 836, 8, 341, 3244, 57776, 445, 6435, 3986, 374, 264, 2193, 2647, 11, 5343, 304, 4265, 25, 3703, 1110, 5204, 905, 7530, 39252, 50704, 2852, 3435, 5144, 290, 26300, 38745, 14, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetMaxSurgeOrDefault(t *testing.T) { maxSurge := intstr.FromInt(2) rolloutNonDefaultValue := &v1alpha1.Rollout{ Spec: v1alpha1.RolloutSpec{ Strategy: v1alpha1.RolloutStrategy{ Canary: &v1alpha1.CanaryStrategy{ MaxSurge: &maxSurge, }, }, }, } assert.Equal(t, maxSurge, *GetMaxSurgeOrDefault(rolloutNonDefaultValue)) rolloutDefaultValue := &v1alpha1.Rollout{} assert.Equal(t, intstr.FromString(DefaultMaxSurge), *GetMaxSurgeOrDefault(rolloutDefaultValue)) }
explode_data.jsonl/15129
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 209 }
[ 2830, 3393, 1949, 5974, 23043, 709, 14188, 1155, 353, 8840, 836, 8, 341, 22543, 23043, 709, 1669, 526, 495, 11439, 1072, 7, 17, 340, 197, 1100, 411, 8121, 41533, 1669, 609, 85, 16, 7141, 16, 71212, 411, 515, 197, 7568, 992, 25, 348,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetWorkspaceByChannelId(t *testing.T) { initMongoConn() defer Close() rand.Seed(time.Now().UnixNano()) w, err := createWorkspace() if err != nil { t.Fatalf(err.Error()) } w2, err := GetWorkspaceByChannelId(w.ChannelId) if err != nil { t.Errorf(err.Error()) } if w2 == nil { t.Errorf("couldnt fetch workspace by channel id got nil, expected: %+v", w) } if w2.ObjectId.Hex() != w.ObjectId.Hex() { t.Errorf("workspaces are not same: expected: %+v, got: ", w) } _, err = GetWorkspaceByChannelId(strconv.FormatInt(rand.Int63(), 10)) if err == nil { t.Errorf("we should not be able to find the WS") } }
explode_data.jsonl/70373
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 260 }
[ 2830, 3393, 1949, 45981, 1359, 9629, 764, 1155, 353, 8840, 836, 8, 341, 28248, 54998, 9701, 741, 16867, 13032, 741, 7000, 437, 5732, 291, 9730, 13244, 1005, 55832, 83819, 12367, 6692, 11, 1848, 1669, 1855, 45981, 741, 743, 1848, 961, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
func Test_defaultErrorMiddleware(t *testing.T) { r := require.New(t) app := New(Options{}) var x string var ok bool app.ErrorHandlers[422] = func(code int, err error, c Context) error { x, ok = c.Value("T").(string) c.Response().WriteHeader(code) c.Response().Write([]byte(err.Error())) return nil } app.Use(func(next Handler) Handler { return func(c Context) error { c.Set("T", "t") return c.Error(422, fmt.Errorf("boom")) } }) app.GET("/", func(c Context) error { return nil }) w := httptest.New(app) res := w.HTML("/").Get() r.Equal(422, res.Code) r.True(ok) r.Equal("t", x) }
explode_data.jsonl/82184
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 265 }
[ 2830, 3393, 9993, 1454, 24684, 1155, 353, 8840, 836, 8, 341, 7000, 1669, 1373, 7121, 1155, 340, 28236, 1669, 1532, 7, 3798, 37790, 2405, 856, 914, 198, 2405, 5394, 1807, 198, 28236, 6141, 39949, 58, 19, 17, 17, 60, 284, 2915, 15842, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFunctionMetadata(t *testing.T) { session := createSession(t) defer session.Close() createFunctions(t, session) functions, err := getFunctionsMetadata(session, "gocql_test") if err != nil { t.Fatalf("failed to query function metadata with err: %v", err) } if functions == nil { t.Fatal("failed to query function metadata, nil returned") } if len(functions) != 2 { t.Fatal("expected two functions") } avgState := functions[1] avgFinal := functions[0] avgStateBody := "if (val !=null) {state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue());}return state;" expectedAvgState := FunctionMetadata{ Keyspace: "gocql_test", Name: "avgstate", ArgumentTypes: []TypeInfo{ TupleTypeInfo{ NativeType: NativeType{typ: TypeTuple}, Elems: []TypeInfo{ NativeType{typ: TypeInt}, NativeType{typ: TypeBigInt}, }, }, NativeType{typ: TypeInt}, }, ArgumentNames: []string{"state", "val"}, ReturnType: TupleTypeInfo{ NativeType: NativeType{typ: TypeTuple}, Elems: []TypeInfo{ NativeType{typ: TypeInt}, NativeType{typ: TypeBigInt}, }, }, CalledOnNullInput: true, Language: "java", Body: avgStateBody, } if !reflect.DeepEqual(avgState, expectedAvgState) { t.Fatalf("function is %+v, but expected %+v", avgState, expectedAvgState) } finalStateBody := "double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r/= state.getInt(0); return Double.valueOf(r);" expectedAvgFinal := FunctionMetadata{ Keyspace: "gocql_test", Name: "avgfinal", ArgumentTypes: []TypeInfo{ TupleTypeInfo{ NativeType: NativeType{typ: TypeTuple}, Elems: []TypeInfo{ NativeType{typ: TypeInt}, NativeType{typ: TypeBigInt}, }, }, }, ArgumentNames: []string{"state"}, ReturnType: NativeType{typ: TypeDouble}, CalledOnNullInput: true, Language: "java", Body: finalStateBody, } if !reflect.DeepEqual(avgFinal, expectedAvgFinal) { t.Fatalf("function is %+v, but expected %+v", avgFinal, expectedAvgFinal) } }
explode_data.jsonl/11178
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 879 }
[ 2830, 3393, 5152, 14610, 1155, 353, 8840, 836, 8, 341, 25054, 1669, 1855, 5283, 1155, 340, 16867, 3797, 10421, 741, 39263, 25207, 1155, 11, 3797, 692, 7527, 82, 11, 1848, 1669, 633, 25207, 14610, 16264, 11, 330, 70, 509, 1470, 4452, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestIsClassCompatible(t *testing.T) { tests := []struct { name string spotInfo instanceTypeInformation instanceCPU int instanceMemory float32 instanceGPU int expected bool }{ {name: "Spot is higher in both CPU & memory", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 2.5, }, instanceCPU: 5, instanceMemory: 1.0, expected: true, }, {name: "Spot is lower in CPU but higher in memory", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 2.5, }, instanceCPU: 15, instanceMemory: 1.0, expected: false, }, {name: "Spot is lower in memory but higher in CPU", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 2.5, }, instanceCPU: 5, instanceMemory: 10.0, expected: false, }, {name: "Spot is lower in both CPU & memory", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 2.5, }, instanceCPU: 15, instanceMemory: 5.0, expected: false, }, {name: "Spot is lower in CPU, memory and GPU ", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 2.5, GPU: 0, }, instanceCPU: 15, instanceMemory: 5.0, instanceGPU: 1, expected: false, }, {name: "Spot is higher in CPU, memory and GPU ", spotInfo: instanceTypeInformation{ vCPU: 10, memory: 20, GPU: 4, }, instanceCPU: 8, instanceMemory: 4, instanceGPU: 2, expected: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { i := &instance{typeInfo: instanceTypeInformation{ vCPU: tt.instanceCPU, memory: tt.instanceMemory, }, } retValue := i.isClassCompatible(tt.spotInfo) if retValue != tt.expected { t.Errorf("Value received: %t expected %t", retValue, tt.expected) } }) } }
explode_data.jsonl/55197
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 875 }
[ 2830, 3393, 3872, 1957, 29161, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 1843, 914, 198, 197, 1903, 19099, 1731, 981, 2867, 929, 14873, 198, 197, 56256, 31615, 262, 526, 198, 197, 56256, 10642, 2224, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
func Test_buildRouteConfiguration(t *testing.T) { srv := &Server{filemgr: filemgr.NewManager()} virtualHosts := make([]*envoy_config_route_v3.VirtualHost, 10) routeConfig, err := srv.buildRouteConfiguration("test-route-configuration", virtualHosts) require.NoError(t, err) assert.Equal(t, "test-route-configuration", routeConfig.GetName()) assert.Equal(t, virtualHosts, routeConfig.GetVirtualHosts()) assert.False(t, routeConfig.GetValidateClusters().GetValue()) }
explode_data.jsonl/36953
{ "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, 20801, 4899, 7688, 1155, 353, 8840, 836, 8, 341, 1903, 10553, 1669, 609, 5475, 90, 1192, 48292, 25, 1034, 48292, 7121, 2043, 23509, 9558, 9296, 82, 1669, 1281, 85288, 3160, 2253, 5332, 28109, 2273, 18, 95979, 9296, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestAttachSubstitutePath(t *testing.T) { if runtime.GOOS == "freebsd" { t.SkipNow() } if runtime.GOOS == "windows" { t.Skip("test skipped on windows, see https://delve.beta.teamcity.com/project/Delve_windows for details") } runTest(t, "loopprog", func(client *daptest.Client, fixture protest.Fixture) { cmd := execFixture(t, fixture) substitutePathTestHelper(t, fixture, client, "attach", map[string]interface{}{"mode": "local", "processId": cmd.Process.Pid}) }) }
explode_data.jsonl/17331
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 179 }
[ 2830, 3393, 30485, 3136, 7660, 1820, 1155, 353, 8840, 836, 8, 341, 743, 15592, 97574, 3126, 621, 330, 10593, 51835, 1, 341, 197, 3244, 57776, 7039, 741, 197, 532, 743, 15592, 97574, 3126, 621, 330, 27077, 1, 341, 197, 3244, 57776, 445...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
func TestPointBls12377G2Hash(t *testing.T) { var b [32]byte bls12377G2 := BLS12377G2() sc := bls12377G2.Point.Hash(b[:]) s, ok := sc.(*PointBls12377G2) require.True(t, ok) expectedX, _ := new(big.Int).SetString("014eec1848d84be62f3a5778353ea6c2b0db859508bc40ff2c1387f0a4b2a167fedbe6b10f946f33c600623d7b96dc8200ef8b67c1e07c4dc522f25deb617ad8251199d235da8bc7700332c8416aa204f81e6bebd914e46acea095d3083b7723", 16) expectedY, _ := new(big.Int).SetString("015c17fb5e37ce1284fa5f10cca9a55be5a5e4d821649294ab820a6f044f55337665df04a940ee7f5d937aff69196b010168d9090eb791d4b21752622f1fd5fb0f4c44bfd83e2cf6d332b02343999fac3de660ca84aff40b428f25b5378fe648", 16) require.Equal(t, s.X(), expectedX) require.Equal(t, s.Y(), expectedY) }
explode_data.jsonl/15763
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 382 }
[ 2830, 3393, 2609, 33, 4730, 16, 17, 18, 22, 22, 38, 17, 6370, 1155, 353, 8840, 836, 8, 341, 2405, 293, 508, 18, 17, 90184, 198, 96421, 82, 16, 17, 18, 22, 22, 38, 17, 1669, 425, 7268, 16, 17, 18, 22, 22, 38, 17, 741, 29928, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPeersToTxnProcessors(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() config := mockfab.DefaultMockConfig(mockCtrl) peer1, err := New(config, WithURL(peer1URL)) if err != nil { t.Fatalf("Failed to create NewPeer error(%s)", err) } peer2, err := New(config, WithURL(peer2URL)) if err != nil { t.Fatalf("Failed to create NewPeer error(%s)", err) } peers := []fab.Peer{peer1, peer2} processors := PeersToTxnProcessors(peers) for i := range peers { if !reflect.DeepEqual(peers[i], processors[i]) { t.Fatal("Peer to Processors mismatch") } } }
explode_data.jsonl/4796
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 244 }
[ 2830, 3393, 10197, 388, 1249, 31584, 77, 7423, 1087, 1155, 353, 8840, 836, 8, 341, 77333, 15001, 1669, 342, 316, 1176, 7121, 2051, 1155, 340, 16867, 7860, 15001, 991, 18176, 2822, 25873, 1669, 7860, 36855, 13275, 11571, 2648, 30389, 15001...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRecover_startHandlerFunc_POST_UserNotFound(t *testing.T) { t.Parallel() rec, _, _ := testSetup() ctx, w, r, _ := testRequest(rec.Authboss, "POST", "username", "john", "confirm_username", "john") err := rec.startHandlerFunc(ctx, w, r) if err == nil { t.Error("Expected error:", err) } rerr, ok := err.(authboss.ErrAndRedirect) if !ok { t.Error("Expected ErrAndRedirect error") } if rerr.Location != rec.RecoverOKPath { t.Error("Unexpected location:", rerr.Location) } if rerr.FlashSuccess != recoverInitiateSuccessFlash { t.Error("Unexpected success flash", rerr.FlashSuccess) } }
explode_data.jsonl/61495
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 234 }
[ 2830, 3393, 693, 3688, 4906, 3050, 9626, 20506, 31339, 10372, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 67904, 11, 8358, 716, 1669, 1273, 21821, 741, 20985, 11, 289, 11, 435, 11, 716, 1669, 1273, 1900, 20635, 25233, 33314, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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