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 TestIgnoreBadResetOnSynSent(t *testing.T) { // Send SYN. tcp := make(header.TCP, header.TCPMinimumSize) tcp.Encode(&header.TCPFields{ SeqNum: 1234, AckNum: 0, DataOffset: header.TCPMinimumSize, Flags: header.TCPFlagSyn, WindowSize: 30000, }) tcb := tcpconntrack.TCB{} tcb.Init(tcp) // Receive a RST with a bad ACK, it should not cause the connection to // be reset. acks := []uint32{1234, 1236, 1000, 5000} flags := []uint8{header.TCPFlagRst, header.TCPFlagRst | header.TCPFlagAck} for _, a := range acks { for _, f := range flags { tcp.Encode(&header.TCPFields{ SeqNum: 789, AckNum: a, DataOffset: header.TCPMinimumSize, Flags: f, WindowSize: 50000, }) if r := tcb.UpdateStateInbound(tcp); r != tcpconntrack.ResultConnecting { t.Fatalf("Bad result: got %v, want %v", r, tcpconntrack.ResultAlive) } } } // Complete the handshake. // Receive SYN-ACK. tcp.Encode(&header.TCPFields{ SeqNum: 789, AckNum: 1235, DataOffset: header.TCPMinimumSize, Flags: header.TCPFlagSyn | header.TCPFlagAck, WindowSize: 50000, }) if r := tcb.UpdateStateInbound(tcp); r != tcpconntrack.ResultAlive { t.Fatalf("Bad result: got %v, want %v", r, tcpconntrack.ResultAlive) } // Send ACK. tcp.Encode(&header.TCPFields{ SeqNum: 1235, AckNum: 790, DataOffset: header.TCPMinimumSize, Flags: header.TCPFlagAck, WindowSize: 30000, }) if r := tcb.UpdateStateOutbound(tcp); r != tcpconntrack.ResultAlive { t.Fatalf("Bad result: got %v, want %v", r, tcpconntrack.ResultAlive) } }
explode_data.jsonl/17728
{ "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, 12497, 17082, 14828, 1925, 37134, 31358, 1155, 353, 8840, 836, 8, 341, 197, 322, 11000, 61694, 624, 3244, 4672, 1669, 1281, 25534, 836, 7123, 11, 4247, 836, 7123, 28695, 1695, 340, 3244, 4672, 50217, 2099, 2708, 836, 7123, 8941, 515, 197, 197, 20183, 4651, 25, 257, 220, 16, 17, 18, 19, 345, 197, 22985, 377, 4651, 25, 257, 220, 15, 345, 197, 40927, 6446, 25, 4247, 836, 7123, 28695, 1695, 345, 197, 197, 9195, 25, 414, 4247, 836, 7123, 12135, 37134, 345, 197, 197, 87817, 25, 220, 18, 15, 15, 15, 15, 345, 197, 8824, 3244, 7221, 1669, 28051, 5148, 13131, 836, 12979, 16094, 3244, 7221, 26849, 98203, 692, 197, 322, 37422, 264, 431, 784, 448, 264, 3873, 53763, 11, 432, 1265, 537, 5240, 279, 3633, 311, 198, 197, 322, 387, 7585, 624, 197, 7821, 1669, 3056, 2496, 18, 17, 90, 16, 17, 18, 19, 11, 220, 16, 17, 18, 21, 11, 220, 16, 15, 15, 15, 11, 220, 20, 15, 15, 15, 532, 59516, 1669, 3056, 2496, 23, 90, 2708, 836, 7123, 12135, 49, 267, 11, 4247, 836, 7123, 12135, 49, 267, 760, 4247, 836, 7123, 12135, 55559, 532, 2023, 8358, 264, 1669, 2088, 10725, 82, 341, 197, 2023, 8358, 282, 1669, 2088, 8042, 341, 298, 3244, 4672, 50217, 2099, 2708, 836, 7123, 8941, 515, 571, 197, 20183, 4651, 25, 257, 220, 22, 23, 24, 345, 571, 22985, 377, 4651, 25, 257, 264, 345, 571, 40927, 6446, 25, 4247, 836, 7123, 28695, 1695, 345, 571, 197, 9195, 25, 414, 282, 345, 571, 197, 87817, 25, 220, 20, 15, 15, 15, 15, 345, 298, 197, 8824, 298, 743, 435, 1669, 93179, 16689, 1397, 641, 10891, 98203, 1215, 435, 961, 28051, 5148, 13131, 18456, 62924, 341, 571, 3244, 30762, 445, 17082, 1102, 25, 2684, 1018, 85, 11, 1366, 1018, 85, 497, 435, 11, 28051, 5148, 13131, 18456, 32637, 340, 298, 197, 532, 197, 197, 532, 197, 630, 197, 322, 18608, 279, 57020, 624, 197, 322, 37422, 61694, 12, 4032, 624, 3244, 4672, 50217, 2099, 2708, 836, 7123, 8941, 515, 197, 197, 20183, 4651, 25, 257, 220, 22, 23, 24, 345, 197, 22985, 377, 4651, 25, 257, 220, 16, 17, 18, 20, 345, 197, 40927, 6446, 25, 4247, 836, 7123, 28695, 1695, 345, 197, 197, 9195, 25, 414, 4247, 836, 7123, 12135, 37134, 760, 4247, 836, 7123, 12135, 55559, 345, 197, 197, 87817, 25, 220, 20, 15, 15, 15, 15, 345, 197, 8824, 743, 435, 1669, 93179, 16689, 1397, 641, 10891, 98203, 1215, 435, 961, 28051, 5148, 13131, 18456, 32637, 341, 197, 3244, 30762, 445, 17082, 1102, 25, 2684, 1018, 85, 11, 1366, 1018, 85, 497, 435, 11, 28051, 5148, 13131, 18456, 32637, 340, 197, 630, 197, 322, 11000, 53763, 624, 3244, 4672, 50217, 2099, 2708, 836, 7123, 8941, 515, 197, 197, 20183, 4651, 25, 257, 220, 16, 17, 18, 20, 345, 197, 22985, 377, 4651, 25, 257, 220, 22, 24, 15, 345, 197, 40927, 6446, 25, 4247, 836, 7123, 28695, 1695, 345, 197, 197, 9195, 25, 414, 4247, 836, 7123, 12135, 55559, 345, 197, 197, 87817, 25, 220, 18, 15, 15, 15, 15, 345, 197, 8824, 743, 435, 1669, 93179, 16689, 1397, 2662, 10891, 98203, 1215, 435, 961, 28051, 5148, 13131, 18456, 32637, 341, 197, 3244, 30762, 445, 17082, 1102, 25, 2684, 1018, 85, 11, 1366, 1018, 85, 497, 435, 11, 28051, 5148, 13131, 18456, 32637, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestV(t *testing.T) { setFlags() defer logging.swap(logging.newBuffers()) logging.verbosity.Set("2") defer logging.verbosity.Set("0") V(2).Info("test") if !contains(infoLog, "I", t) { t.Errorf("Info has wrong character: %q", contents(infoLog)) } if !contains(infoLog, "test", t) { t.Error("Info failed") } }
explode_data.jsonl/8431
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 138 }
[ 2830, 3393, 53, 1155, 353, 8840, 836, 8, 341, 8196, 9195, 741, 16867, 8392, 54537, 51687, 4618, 36219, 2398, 90085, 13, 65210, 4202, 445, 17, 1138, 16867, 8392, 13, 65210, 4202, 445, 15, 1138, 17446, 7, 17, 568, 1731, 445, 1944, 1138, 743, 753, 13372, 14208, 2201, 11, 330, 40, 497, 259, 8, 341, 197, 3244, 13080, 445, 1731, 702, 4969, 3668, 25, 1018, 80, 497, 8794, 14208, 2201, 1171, 197, 532, 743, 753, 13372, 14208, 2201, 11, 330, 1944, 497, 259, 8, 341, 197, 3244, 6141, 445, 1731, 4641, 1138, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAbsCollection_Every(t *testing.T) { intColl := NewIntCollection([]int{1, 2, 3, 4}) if intColl.Every(func(item interface{}, key int) bool { i := item.(int) return i > 1 }) != false { t.Fatal("Every错误") } if intColl.Every(func(item interface{}, key int) bool { i := item.(int) return i > 0 }) != true { t.Fatal("Every错误") } }
explode_data.jsonl/66441
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 154 }
[ 2830, 3393, 27778, 6482, 2089, 1204, 1155, 353, 8840, 836, 8, 341, 2084, 15265, 1669, 1532, 1072, 6482, 10556, 396, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 3518, 743, 526, 15265, 5142, 1204, 18552, 5393, 3749, 22655, 1376, 526, 8, 1807, 341, 197, 8230, 1669, 1509, 12832, 396, 340, 197, 853, 600, 861, 220, 16, 198, 197, 5410, 961, 895, 341, 197, 3244, 26133, 445, 11510, 32100, 1138, 197, 630, 743, 526, 15265, 5142, 1204, 18552, 5393, 3749, 22655, 1376, 526, 8, 1807, 341, 197, 8230, 1669, 1509, 12832, 396, 340, 197, 853, 600, 861, 220, 15, 198, 197, 5410, 961, 830, 341, 197, 3244, 26133, 445, 11510, 32100, 1138, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGenerateHints(t *testing.T) { t.Parallel() alphabet := []rune("abc") tests := []struct { desc string text string matches []Range want []hint }{ { desc: "no matches", text: "foo", want: []hint{}, }, { desc: "single match", text: "foo bar", matches: []Range{ {1, 3}, // f(oo) }, want: []hint{ { Label: "a", Text: "oo", Matches: []Range{ {1, 3}, // f(oo) }, }, }, }, { desc: "duplicated match", text: "foo bar baz qux", matches: []Range{ {4, 6}, // (ba)r {8, 10}, // (ba)z }, want: []hint{ { Label: "a", Text: "ba", Matches: []Range{ {4, 6}, // (ba)r {8, 10}, // (ba)z }, }, }, }, { desc: "multiple matches", text: "foo bar baz qux", matches: []Range{ {0, 3}, // (foo) {4, 6}, // (ba)r {8, 10}, // (ba)z {13, 15}, // q(ux) }, want: []hint{ { Label: "c", Text: "ba", Matches: []Range{ {4, 6}, // (ba)r {8, 10}, // (ba)z }, }, { Label: "a", Text: "foo", Matches: []Range{ {0, 3}, // (foo) }, }, { Label: "b", Text: "ux", Matches: []Range{ {13, 15}, // q(ux) }, }, }, }, } for _, tt := range tests { tt := tt t.Run(tt.desc, func(t *testing.T) { t.Parallel() got := generateHints(alphabet, tt.text, tt.matches) assert.Equal(t, tt.want, got) }) } }
explode_data.jsonl/70476
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 898 }
[ 2830, 3393, 31115, 74933, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 69571, 18485, 1669, 3056, 81, 2886, 445, 13683, 5130, 78216, 1669, 3056, 1235, 341, 197, 41653, 262, 914, 198, 197, 15425, 262, 914, 198, 197, 2109, 9118, 3056, 6046, 198, 197, 50780, 262, 3056, 46125, 198, 197, 59403, 197, 197, 515, 298, 41653, 25, 330, 2152, 9071, 756, 298, 15425, 25, 330, 7975, 756, 298, 50780, 25, 3056, 46125, 38837, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 15338, 2432, 756, 298, 15425, 25, 330, 7975, 3619, 756, 298, 2109, 9118, 25, 3056, 6046, 515, 571, 197, 90, 16, 11, 220, 18, 2137, 442, 282, 7, 2624, 340, 298, 197, 1583, 298, 50780, 25, 3056, 46125, 515, 571, 197, 515, 464, 82126, 25, 330, 64, 756, 464, 49635, 25, 220, 330, 2624, 756, 464, 197, 42470, 25, 3056, 6046, 515, 1144, 197, 90, 16, 11, 220, 18, 2137, 442, 282, 7, 2624, 340, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 67, 98984, 2432, 756, 298, 15425, 25, 330, 7975, 3619, 50247, 922, 87, 756, 298, 2109, 9118, 25, 3056, 6046, 515, 571, 197, 90, 19, 11, 220, 21, 2137, 220, 442, 320, 4645, 93342, 198, 571, 197, 90, 23, 11, 220, 16, 15, 2137, 442, 320, 4645, 8, 89, 198, 298, 197, 1583, 298, 50780, 25, 3056, 46125, 515, 571, 197, 515, 464, 82126, 25, 330, 64, 756, 464, 49635, 25, 220, 330, 4645, 756, 464, 197, 42470, 25, 3056, 6046, 515, 1144, 197, 90, 19, 11, 220, 21, 2137, 220, 442, 320, 4645, 93342, 198, 1144, 197, 90, 23, 11, 220, 16, 15, 2137, 442, 320, 4645, 8, 89, 198, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 35673, 9071, 756, 298, 15425, 25, 330, 7975, 3619, 50247, 922, 87, 756, 298, 2109, 9118, 25, 3056, 6046, 515, 571, 197, 90, 15, 11, 220, 18, 2137, 256, 442, 320, 7975, 340, 571, 197, 90, 19, 11, 220, 21, 2137, 256, 442, 320, 4645, 93342, 198, 571, 197, 90, 23, 11, 220, 16, 15, 2137, 220, 442, 320, 4645, 8, 89, 198, 571, 197, 90, 16, 18, 11, 220, 16, 20, 2137, 442, 2804, 7, 2200, 340, 298, 197, 1583, 298, 50780, 25, 3056, 46125, 515, 571, 197, 515, 464, 82126, 25, 330, 66, 756, 464, 49635, 25, 220, 330, 4645, 756, 464, 197, 42470, 25, 3056, 6046, 515, 1144, 197, 90, 19, 11, 220, 21, 2137, 220, 442, 320, 4645, 93342, 198, 1144, 197, 90, 23, 11, 220, 16, 15, 2137, 442, 320, 4645, 8, 89, 198, 464, 197, 1583, 571, 197, 1583, 571, 197, 515, 464, 82126, 25, 330, 64, 756, 464, 49635, 25, 220, 330, 7975, 756, 464, 197, 42470, 25, 3056, 6046, 515, 1144, 197, 90, 15, 11, 220, 18, 2137, 442, 320, 7975, 340, 464, 197, 1583, 571, 197, 1583, 571, 197, 515, 464, 82126, 25, 330, 65, 756, 464, 49635, 25, 220, 330, 2200, 756, 464, 197, 42470, 25, 3056, 6046, 515, 1144, 197, 90, 16, 18, 11, 220, 16, 20, 2137, 442, 2804, 7, 2200, 340, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 630, 2023, 8358, 17853, 1669, 2088, 7032, 341, 197, 3244, 83, 1669, 17853, 198, 197, 3244, 16708, 47152, 30514, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 3244, 41288, 7957, 2822, 298, 3174, 354, 1669, 6923, 74933, 17643, 18485, 11, 17853, 2788, 11, 17853, 36480, 340, 298, 6948, 12808, 1155, 11, 17853, 70212, 11, 2684, 340, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDelegateCoins(t *testing.T) { input := setupTestInput() now := tmtime.Now() ctx := input.ctx.WithBlockHeader(abci.Header{Time: now}) endTime := now.Add(24 * time.Hour) origCoins := sdk.NewCoins(sdk.NewInt64Coin("hsn", 100)) delCoins := sdk.NewCoins(sdk.NewInt64Coin("hsn", 50)) addr1 := sdk.AccAddress([]byte("addr1")) addr2 := sdk.AccAddress([]byte("addr2")) addrModule := sdk.AccAddress([]byte("moduleAcc")) bacc := auth.NewBaseAccountWithAddress(addr1) bacc.SetCoins(origCoins) macc := input.ak.NewAccountWithAddress(ctx, addrModule) // we don't need to define an actual module account bc we just need the address for testing vacc := auth.NewContinuousVestingAccount(&bacc, ctx.BlockHeader().Time.Unix(), endTime.Unix()) acc := input.ak.NewAccountWithAddress(ctx, addr2) input.ak.SetAccount(ctx, vacc) input.ak.SetAccount(ctx, acc) input.ak.SetAccount(ctx, macc) input.k.SetCoins(ctx, addr2, origCoins) ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) // require the ability for a non-vesting account to delegate err := input.k.DelegateCoins(ctx, addr2, addrModule, delCoins) acc = input.ak.GetAccount(ctx, addr2) macc = input.ak.GetAccount(ctx, addrModule) require.NoError(t, err) require.Equal(t, origCoins.Sub(delCoins), acc.GetCoins()) require.Equal(t, delCoins, macc.GetCoins()) // require the ability for a vesting account to delegate err = input.k.DelegateCoins(ctx, addr1, addrModule, delCoins) vacc = input.ak.GetAccount(ctx, addr1).(*auth.ContinuousVestingAccount) require.NoError(t, err) require.Equal(t, delCoins, vacc.GetCoins()) }
explode_data.jsonl/3534
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 591 }
[ 2830, 3393, 9381, 69602, 1155, 353, 8840, 836, 8, 341, 22427, 1669, 6505, 2271, 2505, 741, 80922, 1669, 17333, 1678, 13244, 741, 20985, 1669, 1946, 30608, 26124, 4713, 4047, 56085, 5855, 15753, 90, 1462, 25, 1431, 3518, 6246, 1462, 1669, 1431, 1904, 7, 17, 19, 353, 882, 73550, 692, 197, 4670, 69602, 1669, 45402, 7121, 69602, 1141, 7584, 7121, 1072, 21, 19, 41180, 445, 4997, 77, 497, 220, 16, 15, 15, 1171, 69509, 69602, 1669, 45402, 7121, 69602, 1141, 7584, 7121, 1072, 21, 19, 41180, 445, 4997, 77, 497, 220, 20, 15, 4390, 53183, 16, 1669, 45402, 77538, 4286, 10556, 3782, 445, 6214, 16, 5455, 53183, 17, 1669, 45402, 77538, 4286, 10556, 3782, 445, 6214, 17, 5455, 53183, 3332, 1669, 45402, 77538, 4286, 10556, 3782, 445, 4352, 14603, 28075, 2233, 4475, 1669, 4166, 7121, 3978, 7365, 2354, 4286, 24497, 16, 340, 2233, 4475, 4202, 69602, 54837, 69602, 340, 2109, 4475, 1669, 1946, 65191, 7121, 7365, 2354, 4286, 7502, 11, 10789, 3332, 8, 442, 582, 1513, 944, 1184, 311, 6979, 458, 5042, 4688, 2692, 17916, 582, 1101, 1184, 279, 2621, 369, 7497, 198, 5195, 4475, 1669, 4166, 7121, 94780, 53, 59855, 7365, 2099, 65, 4475, 11, 5635, 28477, 4047, 1005, 1462, 10616, 941, 1507, 32061, 10616, 941, 2398, 197, 4475, 1669, 1946, 65191, 7121, 7365, 2354, 4286, 7502, 11, 10789, 17, 340, 22427, 65191, 4202, 7365, 7502, 11, 13712, 340, 22427, 65191, 4202, 7365, 7502, 11, 1029, 340, 22427, 65191, 4202, 7365, 7502, 11, 296, 4475, 340, 22427, 5202, 4202, 69602, 7502, 11, 10789, 17, 11, 2713, 69602, 692, 20985, 284, 5635, 26124, 4713, 1462, 32263, 1904, 7, 16, 17, 353, 882, 73550, 4390, 197, 322, 1373, 279, 5726, 369, 264, 2477, 12, 7019, 287, 2692, 311, 13380, 198, 9859, 1669, 1946, 5202, 8934, 4989, 69602, 7502, 11, 10789, 17, 11, 10789, 3332, 11, 1594, 69602, 340, 197, 4475, 284, 1946, 65191, 2234, 7365, 7502, 11, 10789, 17, 340, 2109, 4475, 284, 1946, 65191, 2234, 7365, 7502, 11, 10789, 3332, 340, 17957, 35699, 1155, 11, 1848, 340, 17957, 12808, 1155, 11, 2713, 69602, 12391, 55927, 69602, 701, 1029, 2234, 69602, 2398, 17957, 12808, 1155, 11, 1594, 69602, 11, 296, 4475, 2234, 69602, 12367, 197, 322, 1373, 279, 5726, 369, 264, 27605, 287, 2692, 311, 13380, 198, 9859, 284, 1946, 5202, 8934, 4989, 69602, 7502, 11, 10789, 16, 11, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestConnServers(t *testing.T) { opts := GetDefaultOptions() c := &Conn{Opts: opts} c.ps = &parseState{} c.setupServerPool() validateURLs := func(serverUrls []string, expectedUrls ...string) { var found bool if len(serverUrls) != len(expectedUrls) { stackFatalf(t, "Array should have %d elements, has %d", len(expectedUrls), len(serverUrls)) } for _, ev := range expectedUrls { found = false for _, av := range serverUrls { if ev == av { found = true break } } if !found { stackFatalf(t, "array is missing %q in %v", ev, serverUrls) } } } // check the default url validateURLs(c.Servers(), "nats://localhost:4222") if len(c.DiscoveredServers()) != 0 { t.Fatalf("Expected no discovered servers") } // Add a new URL err := c.parse([]byte("INFO {\"connect_urls\":[\"localhost:5222\"]}\r\n")) if err != nil { t.Fatalf("Unexpected: %d : %v\n", c.ps.state, err) } // Server list should now contain both the default and the new url. validateURLs(c.Servers(), "nats://localhost:4222", "nats://localhost:5222") // Discovered servers should only contain the new url. validateURLs(c.DiscoveredServers(), "nats://localhost:5222") // verify user credentials are stripped out. opts.Servers = []string{"nats://user:pass@localhost:4333", "nats://token@localhost:4444"} c = &Conn{Opts: opts} c.ps = &parseState{} c.setupServerPool() validateURLs(c.Servers(), "nats://localhost:4333", "nats://localhost:4444") }
explode_data.jsonl/44919
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 582 }
[ 2830, 3393, 9701, 78139, 1155, 353, 8840, 836, 8, 341, 64734, 1669, 2126, 3675, 3798, 741, 1444, 1669, 609, 9701, 90, 43451, 25, 12185, 532, 1444, 57328, 284, 609, 6400, 1397, 16094, 1444, 25338, 5475, 10551, 2822, 197, 7067, 3144, 82, 1669, 2915, 21421, 15638, 3056, 917, 11, 3601, 15638, 2503, 917, 8, 341, 197, 2405, 1730, 1807, 198, 197, 743, 2422, 21421, 15638, 8, 961, 2422, 15253, 15638, 8, 341, 298, 48227, 68457, 3104, 1155, 11, 330, 1857, 1265, 614, 1018, 67, 5424, 11, 702, 1018, 67, 497, 2422, 15253, 15638, 701, 2422, 21421, 15638, 1171, 197, 197, 630, 197, 2023, 8358, 3637, 1669, 2088, 3601, 15638, 341, 298, 58102, 284, 895, 198, 298, 2023, 8358, 1822, 1669, 2088, 3538, 15638, 341, 571, 743, 3637, 621, 1822, 341, 464, 58102, 284, 830, 198, 464, 3388, 198, 571, 197, 532, 298, 197, 532, 298, 743, 753, 15105, 341, 571, 48227, 68457, 3104, 1155, 11, 330, 1653, 374, 7402, 1018, 80, 304, 1018, 85, 497, 3637, 11, 3538, 15638, 340, 298, 197, 532, 197, 197, 532, 197, 630, 197, 322, 1779, 279, 1638, 2515, 198, 197, 7067, 3144, 82, 1337, 808, 18729, 1507, 330, 77, 1862, 1110, 8301, 25, 19, 17, 17, 17, 1138, 743, 2422, 1337, 10166, 20804, 78139, 2140, 961, 220, 15, 341, 197, 3244, 30762, 445, 18896, 902, 11105, 16293, 1138, 197, 630, 197, 322, 2691, 264, 501, 5548, 198, 9859, 1669, 272, 4632, 10556, 3782, 445, 6637, 314, 2105, 6459, 32822, 59, 8899, 2105, 8301, 25, 20, 17, 17, 17, 75104, 11035, 81, 1699, 5455, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 29430, 25, 1018, 67, 549, 1018, 85, 1699, 497, 272, 57328, 3467, 11, 1848, 340, 197, 532, 197, 322, 8422, 1140, 1265, 1431, 6644, 2176, 279, 1638, 323, 279, 501, 2515, 624, 197, 7067, 3144, 82, 1337, 808, 18729, 1507, 330, 77, 1862, 1110, 8301, 25, 19, 17, 17, 17, 497, 330, 77, 1862, 1110, 8301, 25, 20, 17, 17, 17, 1138, 197, 322, 4093, 20804, 16293, 1265, 1172, 6644, 279, 501, 2515, 624, 197, 7067, 3144, 82, 1337, 10166, 20804, 78139, 1507, 330, 77, 1862, 1110, 8301, 25, 20, 17, 17, 17, 5130, 197, 322, 10146, 1196, 16387, 525, 36679, 700, 624, 64734, 808, 18729, 284, 3056, 917, 4913, 77, 1862, 1110, 872, 25, 6385, 31, 8301, 25, 19, 18, 18, 18, 497, 330, 77, 1862, 1110, 5839, 31, 8301, 25, 19, 19, 19, 19, 16707, 1444, 284, 609, 9701, 90, 43451, 25, 12185, 532, 1444, 57328, 284, 609, 6400, 1397, 16094, 1444, 25338, 5475, 10551, 2822, 197, 7067, 3144, 82, 1337, 808, 18729, 1507, 330, 77, 1862, 1110, 8301, 25, 19, 18, 18, 18, 497, 330, 77, 1862, 1110, 8301, 25, 19, 19, 19, 19, 1138, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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1, 1, 1, 1 ]
6
func TestAttributeValue(t *testing.T) { v := NewAttributeValueString("abc") assert.EqualValues(t, AttributeValueSTRING, v.Type()) assert.EqualValues(t, "abc", v.StringVal()) v = NewAttributeValueInt(123) assert.EqualValues(t, AttributeValueINT, v.Type()) assert.EqualValues(t, 123, v.IntVal()) v = NewAttributeValueDouble(3.4) assert.EqualValues(t, AttributeValueDOUBLE, v.Type()) assert.EqualValues(t, 3.4, v.DoubleVal()) v = NewAttributeValueBool(true) assert.EqualValues(t, AttributeValueBOOL, v.Type()) assert.EqualValues(t, true, v.BoolVal()) v = NewAttributeValueNull() assert.EqualValues(t, AttributeValueNULL, v.Type()) v.SetStringVal("abc") assert.EqualValues(t, AttributeValueSTRING, v.Type()) assert.EqualValues(t, "abc", v.StringVal()) v.SetIntVal(123) assert.EqualValues(t, AttributeValueINT, v.Type()) assert.EqualValues(t, 123, v.IntVal()) v.SetDoubleVal(3.4) assert.EqualValues(t, AttributeValueDOUBLE, v.Type()) assert.EqualValues(t, 3.4, v.DoubleVal()) v.SetBoolVal(true) assert.EqualValues(t, AttributeValueBOOL, v.Type()) assert.EqualValues(t, true, v.BoolVal()) }
explode_data.jsonl/38191
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 436 }
[ 2830, 3393, 78554, 1155, 353, 8840, 836, 8, 341, 5195, 1669, 1532, 78554, 703, 445, 13683, 1138, 6948, 12808, 6227, 1155, 11, 16752, 1130, 16468, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 330, 13683, 497, 348, 6431, 2208, 12367, 5195, 284, 1532, 78554, 1072, 7, 16, 17, 18, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 3221, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 220, 16, 17, 18, 11, 348, 7371, 2208, 12367, 5195, 284, 1532, 78554, 7378, 7, 18, 13, 19, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 77647, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 220, 18, 13, 19, 11, 348, 36113, 2208, 12367, 5195, 284, 1532, 78554, 11233, 3715, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 10395, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 830, 11, 348, 52497, 2208, 12367, 5195, 284, 1532, 78554, 3280, 741, 6948, 12808, 6227, 1155, 11, 16752, 1130, 4576, 11, 348, 10184, 12367, 5195, 97304, 2208, 445, 13683, 1138, 6948, 12808, 6227, 1155, 11, 16752, 1130, 16468, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 330, 13683, 497, 348, 6431, 2208, 12367, 5195, 84725, 2208, 7, 16, 17, 18, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 3221, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 220, 16, 17, 18, 11, 348, 7371, 2208, 12367, 5195, 4202, 7378, 2208, 7, 18, 13, 19, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 77647, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 220, 18, 13, 19, 11, 348, 36113, 2208, 12367, 5195, 57197, 2208, 3715, 340, 6948, 12808, 6227, 1155, 11, 16752, 1130, 10395, 11, 348, 10184, 2398, 6948, 12808, 6227, 1155, 11, 830, 11, 348, 52497, 2208, 2398, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPerformRequestWithLoggerAndTracer(t *testing.T) { var lw bytes.Buffer lout := log.New(&lw, "LOGGER ", log.LstdFlags) var tw bytes.Buffer tout := log.New(&tw, "TRACER ", log.LstdFlags) client, err := NewClient(SetInfoLog(lout), SetTraceLog(tout), SetSniff(false)) if err != nil { t.Fatal(err) } res, err := client.PerformRequest(context.TODO(), "GET", "/", nil, nil) if err != nil { t.Fatal(err) } if res == nil { t.Fatal("expected response to be != nil") } ret := new(PingResult) if err := json.Unmarshal(res.Body, ret); err != nil { t.Fatalf("expected no error on decode; got: %v", err) } if ret.ClusterName == "" { t.Errorf("expected cluster name; got: %q", ret.ClusterName) } lgot := lw.String() if lgot == "" { t.Errorf("expected logger output; got: %q", lgot) } tgot := tw.String() if tgot == "" { t.Errorf("expected tracer output; got: %q", tgot) } }
explode_data.jsonl/38020
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 376 }
[ 2830, 3393, 46951, 1900, 2354, 7395, 3036, 1282, 9584, 1155, 353, 8840, 836, 8, 341, 2405, 41073, 5820, 22622, 198, 8810, 411, 1669, 1487, 7121, 2099, 57053, 11, 330, 82400, 3670, 1487, 1214, 1834, 9195, 692, 2405, 4384, 5820, 22622, 198, 3244, 411, 1669, 1487, 7121, 2099, 15560, 11, 330, 2378, 1706, 640, 3670, 1487, 1214, 1834, 9195, 692, 25291, 11, 1848, 1669, 1532, 2959, 52474, 1731, 2201, 2333, 411, 701, 2573, 6550, 2201, 1155, 411, 701, 2573, 20720, 3092, 3576, 1171, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 10202, 11, 1848, 1669, 2943, 21746, 1900, 5378, 90988, 1507, 330, 3806, 497, 64657, 2092, 11, 2092, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 743, 592, 621, 2092, 341, 197, 3244, 26133, 445, 7325, 2033, 311, 387, 961, 2092, 1138, 197, 630, 11262, 1669, 501, 5304, 287, 2077, 340, 743, 1848, 1669, 2951, 38097, 4590, 20934, 11, 2112, 1215, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 7325, 902, 1465, 389, 16895, 26, 2684, 25, 1018, 85, 497, 1848, 340, 197, 532, 743, 2112, 72883, 675, 621, 1591, 341, 197, 3244, 13080, 445, 7325, 10652, 829, 26, 2684, 25, 1018, 80, 497, 2112, 72883, 675, 340, 197, 630, 8810, 22390, 1669, 41073, 6431, 741, 743, 326, 22390, 621, 1591, 341, 197, 3244, 13080, 445, 7325, 5925, 2550, 26, 2684, 25, 1018, 80, 497, 326, 22390, 340, 197, 630, 3244, 22390, 1669, 4384, 6431, 741, 743, 259, 22390, 621, 1591, 341, 197, 3244, 13080, 445, 7325, 64306, 2550, 26, 2684, 25, 1018, 80, 497, 259, 22390, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPerm_MustPlatformAdmin(t *testing.T) { // setup types secret := "superSecret" u := new(library.User) u.SetID(1) u.SetName("foo") u.SetToken("bar") u.SetHash("baz") u.SetAdmin(true) tok, _ := token.CreateAccessToken(u, accessTokenDuration) // setup database db, _ := database.NewTest() defer func() { db.Database.Exec("delete from users;") db.Database.Close() }() _ = db.CreateUser(u) // setup context gin.SetMode(gin.TestMode) resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/admin/users", nil) context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tok)) // setup github mock server engine.GET("/api/v3/user", func(c *gin.Context) { c.String(http.StatusOK, userPayload) }) s := httptest.NewServer(engine) defer s.Close() // setup client client, _ := github.NewTest(s.URL) // setup vela mock server engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) engine.Use(func(c *gin.Context) { database.ToContext(c, db) }) engine.Use(func(c *gin.Context) { source.ToContext(c, client) }) engine.Use(user.Establish()) engine.Use(MustPlatformAdmin()) engine.GET("/admin/users", func(c *gin.Context) { c.Status(http.StatusOK) }) s1 := httptest.NewServer(engine) defer s1.Close() // run test engine.ServeHTTP(context.Writer, context.Request) if resp.Code != http.StatusOK { t.Errorf("MustPlatAdmin returned %v, want %v", resp.Code, http.StatusOK) } }
explode_data.jsonl/8185
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 577 }
[ 2830, 3393, 81245, 1245, 590, 17296, 7210, 1155, 353, 8840, 836, 8, 341, 197, 322, 6505, 4494, 198, 197, 20474, 1669, 330, 9522, 19773, 1837, 10676, 1669, 501, 93299, 7344, 340, 10676, 4202, 915, 7, 16, 340, 10676, 4202, 675, 445, 7975, 1138, 10676, 4202, 3323, 445, 2257, 1138, 10676, 4202, 6370, 445, 42573, 1138, 10676, 4202, 7210, 3715, 692, 3244, 562, 11, 716, 1669, 3950, 7251, 37649, 8154, 11, 37725, 12945, 692, 197, 322, 6505, 4625, 198, 20939, 11, 716, 1669, 4625, 7121, 2271, 2822, 16867, 2915, 368, 341, 197, 20939, 25008, 30798, 445, 4542, 504, 3847, 91812, 197, 20939, 25008, 10421, 741, 197, 66816, 197, 62, 284, 2927, 7251, 1474, 8154, 692, 197, 322, 6505, 2266, 198, 3174, 258, 4202, 3636, 3268, 258, 8787, 3636, 692, 34653, 1669, 54320, 70334, 7121, 47023, 741, 28413, 11, 4712, 1669, 46183, 7251, 2271, 1972, 20267, 692, 28413, 9659, 11, 716, 284, 1758, 75274, 19886, 20798, 1949, 11, 3521, 2882, 19178, 497, 2092, 340, 28413, 9659, 15753, 1904, 445, 18124, 497, 8879, 17305, 445, 26399, 1018, 82, 497, 9628, 4390, 197, 322, 6505, 31004, 7860, 3538, 198, 80118, 17410, 4283, 2068, 5457, 18, 11739, 497, 2915, 1337, 353, 8163, 9328, 8, 341, 197, 1444, 6431, 19886, 52989, 11, 1196, 29683, 340, 197, 8824, 1903, 1669, 54320, 70334, 7121, 5475, 48974, 340, 16867, 274, 10421, 2822, 197, 322, 6505, 2943, 198, 25291, 11, 716, 1669, 31004, 7121, 2271, 1141, 20893, 692, 197, 322, 6505, 348, 8294, 7860, 3538, 198, 80118, 9046, 18552, 1337, 353, 8163, 9328, 8, 314, 272, 4202, 445, 20474, 497, 6234, 8, 2751, 80118, 9046, 18552, 1337, 353, 8163, 9328, 8, 314, 4625, 3274, 1972, 1337, 11, 2927, 8, 2751, 80118, 9046, 18552, 1337, 353, 8163, 9328, 8, 314, 2530, 3274, 1972, 1337, 11, 2943, 8, 2751, 80118, 9046, 4277, 84972, 5102, 2398, 80118, 9046, 3189, 590, 17296, 7210, 2398, 80118, 17410, 4283, 2882, 19178, 497, 2915, 1337, 353, 8163, 9328, 8, 341, 197, 1444, 10538, 19886, 52989, 340, 197, 8824, 1903, 16, 1669, 54320, 70334, 7121, 5475, 48974, 340, 16867, 274, 16, 10421, 2822, 197, 322, 1598, 1273, 198, 80118, 83535, 9230, 5378, 47838, 11, 2266, 9659, 692, 743, 9039, 20274, 961, 1758, 52989, 341, 197, 3244, 13080, 445, 31776, 2120, 266, 7210, 5927, 1018, 85, 11, 1366, 1018, 85, 497, 9039, 20274, 11, 1758, 52989, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
func TestError(t *testing.T) { t.Parallel() tests := []struct { in database.Error want string }{ { database.Error{Description: "some error"}, "some error", }, { database.Error{Description: "human-readable error"}, "human-readable error", }, { database.Error{ ErrorCode: database.ErrDriverSpecific, Description: "some error", Err: errors.New("driver-specific error"), }, "some error: driver-specific error", }, } t.Logf("Running %d tests", len(tests)) for i, test := range tests { result := test.in.Error() if result != test.want { t.Errorf("Error #%d\n got: %s want: %s", i, result, test.want) continue } } }
explode_data.jsonl/7153
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 294 }
[ 2830, 3393, 1454, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 78216, 1669, 3056, 1235, 341, 197, 17430, 256, 4625, 6141, 198, 197, 50780, 914, 198, 197, 59403, 197, 197, 515, 298, 2698, 2211, 6141, 90, 5009, 25, 330, 14689, 1465, 7115, 298, 197, 1, 14689, 1465, 756, 197, 197, 1583, 197, 197, 515, 298, 2698, 2211, 6141, 90, 5009, 25, 330, 25312, 83218, 1465, 7115, 298, 197, 1, 25312, 83218, 1465, 756, 197, 197, 1583, 197, 197, 515, 298, 2698, 2211, 6141, 515, 571, 197, 30748, 25, 256, 4625, 27862, 11349, 47514, 345, 571, 47414, 25, 330, 14689, 1465, 756, 571, 197, 7747, 25, 260, 5975, 7121, 445, 12521, 18906, 1465, 4461, 298, 197, 1583, 298, 197, 1, 14689, 1465, 25, 5579, 18906, 1465, 756, 197, 197, 1583, 197, 630, 3244, 98954, 445, 18990, 1018, 67, 7032, 497, 2422, 8623, 82, 1171, 2023, 600, 11, 1273, 1669, 2088, 7032, 341, 197, 9559, 1669, 1273, 1858, 6141, 741, 197, 743, 1102, 961, 1273, 70212, 341, 298, 3244, 13080, 445, 1454, 50594, 67, 1699, 2684, 25, 1018, 82, 1366, 25, 1018, 82, 497, 600, 11, 1102, 345, 571, 18185, 70212, 340, 298, 11664, 198, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestListRepoTeams(t *testing.T) { expectedTeams := []Team{ {ID: 1, Slug: "foo", Permission: RepoPull}, {ID: 2, Slug: "bar", Permission: RepoPush}, {ID: 3, Slug: "foobar", Permission: RepoAdmin}, } ts := simpleTestServer(t, "/repos/org/repo/teams", expectedTeams) defer ts.Close() c := getClient(ts.URL) teams, err := c.ListRepoTeams("org", "repo") if err != nil { t.Errorf("Didn't expect error: %v", err) } else if len(teams) != 3 { t.Errorf("Expected three teams, found %d: %v", len(teams), teams) return } if !reflect.DeepEqual(teams, expectedTeams) { t.Errorf("Wrong list of teams, expected: %v, got: %v", expectedTeams, teams) } }
explode_data.jsonl/6290
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 280 }
[ 2830, 3393, 852, 25243, 60669, 1155, 353, 8840, 836, 8, 341, 42400, 60669, 1669, 3056, 14597, 515, 197, 197, 90, 915, 25, 220, 16, 11, 93613, 25, 330, 7975, 497, 18135, 25, 71509, 36068, 1583, 197, 197, 90, 915, 25, 220, 17, 11, 93613, 25, 330, 2257, 497, 18135, 25, 71509, 16644, 1583, 197, 197, 90, 915, 25, 220, 18, 11, 93613, 25, 330, 50267, 497, 18135, 25, 71509, 7210, 1583, 197, 532, 57441, 1669, 4285, 2271, 5475, 1155, 11, 3521, 68354, 41361, 10758, 5368, 14, 38496, 497, 3601, 60669, 340, 16867, 10591, 10421, 741, 1444, 1669, 86287, 35864, 20893, 340, 197, 38496, 11, 1848, 1669, 272, 5814, 25243, 60669, 445, 1775, 497, 330, 23476, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 86519, 944, 1720, 1465, 25, 1018, 85, 497, 1848, 340, 197, 92, 770, 421, 2422, 7, 38496, 8, 961, 220, 18, 341, 197, 3244, 13080, 445, 18896, 2326, 7263, 11, 1730, 1018, 67, 25, 1018, 85, 497, 2422, 7, 38496, 701, 7263, 340, 197, 853, 198, 197, 532, 743, 753, 34913, 94750, 7, 38496, 11, 3601, 60669, 8, 341, 197, 3244, 13080, 445, 29185, 1140, 315, 7263, 11, 3601, 25, 1018, 85, 11, 2684, 25, 1018, 85, 497, 3601, 60669, 11, 7263, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestClientStoreConfig(t *testing.T) { var err error config := &StoreConfig{} config.DriverName = DriverNameClientStore config.ClientStoreKey = "test" config.TokenLifetime = "1h" config.TokenMaxLifetime = "168h" config.TokenContextName = "token" config.CookieName = "cookiename" config.CookiePath = "/" config.CookieSecure = true config.UpdateActiveIntervalInSecond = 100 store := New() err = config.ApplyTo(store) if err != nil { panic(err) } if store.TokenLifetime != 1*time.Hour { t.Fatal(store.TokenLifetime) } if store.TokenMaxLifetime != 7*24*time.Hour { t.Fatal(store.TokenMaxLifetime) } if store.CookieName != "cookiename" { t.Fatal(store.CookieName) } if store.CookiePath != "/" { t.Fatal(store.CookiePath) } if store.CookieSecure != true { t.Fatal(store.CookieSecure) } if store.UpdateActiveInterval != 100*time.Second { t.Fatal(store.UpdateActiveInterval) } }
explode_data.jsonl/17577
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 362 }
[ 2830, 3393, 2959, 6093, 2648, 1155, 353, 8840, 836, 8, 341, 2405, 1848, 1465, 198, 25873, 1669, 609, 6093, 2648, 16094, 25873, 41768, 675, 284, 14577, 675, 2959, 6093, 198, 25873, 11716, 6093, 1592, 284, 330, 1944, 698, 25873, 32277, 74579, 284, 330, 16, 71, 698, 25873, 32277, 5974, 74579, 284, 330, 16, 21, 23, 71, 698, 25873, 32277, 1972, 675, 284, 330, 5839, 698, 25873, 82918, 675, 284, 330, 1015, 38191, 1840, 698, 25873, 82918, 1820, 284, 80455, 25873, 82918, 49813, 284, 830, 198, 25873, 16689, 5728, 10256, 641, 15666, 284, 220, 16, 15, 15, 198, 57279, 1669, 1532, 741, 9859, 284, 2193, 36051, 1249, 31200, 340, 743, 1848, 961, 2092, 341, 197, 30764, 3964, 340, 197, 532, 743, 3553, 32277, 74579, 961, 220, 16, 77053, 73550, 341, 197, 3244, 26133, 31200, 32277, 74579, 340, 197, 532, 743, 3553, 32277, 5974, 74579, 961, 220, 22, 9, 17, 19, 77053, 73550, 341, 197, 3244, 26133, 31200, 32277, 5974, 74579, 340, 197, 532, 743, 3553, 82918, 675, 961, 330, 1015, 38191, 1840, 1, 341, 197, 3244, 26133, 31200, 82918, 675, 340, 197, 532, 743, 3553, 82918, 1820, 961, 16891, 341, 197, 3244, 26133, 31200, 82918, 1820, 340, 197, 532, 743, 3553, 82918, 49813, 961, 830, 341, 197, 3244, 26133, 31200, 82918, 49813, 340, 197, 532, 743, 3553, 16689, 5728, 10256, 961, 220, 16, 15, 15, 77053, 32435, 341, 197, 3244, 26133, 31200, 16689, 5728, 10256, 692, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestStringBuilder_Empty(t *testing.T) { mem := memory.NewCheckedAllocator(memory.NewGoAllocator()) defer mem.AssertSize(t, 0) want := []string{"hello", "世界", "", "bye"} ab := array.NewStringBuilder(mem) defer ab.Release() stringValues := func(a *array.String) []string { vs := make([]string, a.Len()) for i := range vs { vs[i] = a.Value(i) } return vs } ab.AppendValues([]string{}, nil) a := ab.NewStringArray() assert.Zero(t, a.Len()) a.Release() ab.AppendValues(nil, nil) a = ab.NewStringArray() assert.Zero(t, a.Len()) a.Release() ab.AppendValues([]string{}, nil) ab.AppendValues(want, nil) a = ab.NewStringArray() assert.Equal(t, want, stringValues(a)) a.Release() ab.AppendValues(want, nil) ab.AppendValues([]string{}, nil) a = ab.NewStringArray() assert.Equal(t, want, stringValues(a)) a.Release() }
explode_data.jsonl/4257
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 355 }
[ 2830, 3393, 69412, 76060, 1595, 1155, 353, 8840, 836, 8, 341, 14145, 1669, 4938, 7121, 12666, 42730, 63230, 7121, 10850, 42730, 2398, 16867, 1833, 11711, 1695, 1155, 11, 220, 15, 692, 50780, 1669, 3056, 917, 4913, 14990, 497, 330, 99489, 497, 7342, 330, 28374, 63159, 197, 370, 1669, 1334, 7121, 69412, 39908, 340, 16867, 668, 58693, 2822, 11357, 6227, 1669, 2915, 2877, 353, 1653, 6431, 8, 3056, 917, 341, 197, 5195, 82, 1669, 1281, 10556, 917, 11, 264, 65819, 2398, 197, 2023, 600, 1669, 2088, 6165, 341, 298, 5195, 82, 989, 60, 284, 264, 6167, 1956, 340, 197, 197, 532, 197, 853, 6165, 198, 197, 630, 197, 370, 8982, 6227, 10556, 917, 22655, 2092, 340, 11323, 1669, 668, 7121, 703, 1857, 741, 6948, 35489, 1155, 11, 264, 65819, 2398, 11323, 58693, 2822, 197, 370, 8982, 6227, 27907, 11, 2092, 340, 11323, 284, 668, 7121, 703, 1857, 741, 6948, 35489, 1155, 11, 264, 65819, 2398, 11323, 58693, 2822, 197, 370, 8982, 6227, 10556, 917, 22655, 2092, 340, 197, 370, 8982, 6227, 3622, 517, 11, 2092, 340, 11323, 284, 668, 7121, 703, 1857, 741, 6948, 12808, 1155, 11, 1366, 11, 914, 6227, 2877, 1171, 11323, 58693, 2822, 197, 370, 8982, 6227, 3622, 517, 11, 2092, 340, 197, 370, 8982, 6227, 10556, 917, 22655, 2092, 340, 11323, 284, 668, 7121, 703, 1857, 741, 6948, 12808, 1155, 11, 1366, 11, 914, 6227, 2877, 1171, 11323, 58693, 741, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRunner(t *testing.T) { t.Run("example input", func(t *testing.T) { data, err := file.ReadFullData("../example.txt") if err != nil { t.Fatal(err) } want := 739785 got := Runner(data) if got != want { t.Errorf("got %v want %v", got, want) } }) t.Run("full input", func(t *testing.T) { data, err := file.ReadFullData("../input.txt") if err != nil { t.Fatal(err) } got := Runner(data) fmt.Println(got, "is the answer") }) }
explode_data.jsonl/17925
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 211 }
[ 2830, 3393, 19486, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 8687, 1946, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 8924, 11, 1848, 1669, 1034, 6503, 9432, 1043, 17409, 8687, 3909, 1138, 197, 743, 1848, 961, 2092, 341, 298, 3244, 26133, 3964, 340, 197, 197, 532, 197, 50780, 1669, 220, 22, 18, 24, 22, 23, 20, 198, 197, 3174, 354, 1669, 44946, 2592, 692, 197, 743, 2684, 961, 1366, 341, 298, 3244, 13080, 445, 22390, 1018, 85, 1366, 1018, 85, 497, 2684, 11, 1366, 340, 197, 197, 532, 197, 3518, 3244, 16708, 445, 8878, 1946, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 8924, 11, 1848, 1669, 1034, 6503, 9432, 1043, 17409, 1355, 3909, 1138, 197, 743, 1848, 961, 2092, 341, 298, 3244, 26133, 3964, 340, 197, 197, 532, 197, 3174, 354, 1669, 44946, 2592, 340, 197, 11009, 12419, 3268, 354, 11, 330, 285, 279, 4226, 1138, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestBatchError(t *testing.T) { testCases := []struct { req [2]string errMsg string }{ { req: [2]string{"\xff\xff\xff\xff", "a"}, errMsg: "must be less than KeyMax", }, { req: [2]string{"a", "\xff\xff\xff\xff"}, errMsg: "must be less than or equal to KeyMax", }, } for i, c := range testCases { var ba roachpb.BatchRequest ba.Add(&roachpb.ScanRequest{RequestHeader: roachpb.RequestHeader{ Key: roachpb.Key(c.req[0]), EndKey: roachpb.Key(c.req[1]), }}) if _, err := Range(ba.Requests); !testutils.IsError(err, c.errMsg) { t.Errorf("%d: unexpected error %v", i, err) } } // Test a case where a non-range request has an end key. var ba roachpb.BatchRequest ba.Add(&roachpb.GetRequest{RequestHeader: roachpb.RequestHeader{ Key: roachpb.Key("a"), EndKey: roachpb.Key("b"), }}) if _, err := Range(ba.Requests); !testutils.IsError(err, "end key specified for non-range operation") { t.Errorf("unexpected error %v", err) } }
explode_data.jsonl/56598
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 421 }
[ 2830, 3393, 21074, 1454, 1155, 353, 8840, 836, 8, 341, 18185, 37302, 1669, 3056, 1235, 341, 197, 24395, 262, 508, 17, 30953, 198, 197, 9859, 6611, 914, 198, 197, 59403, 197, 197, 515, 298, 24395, 25, 262, 508, 17, 30953, 4913, 59, 9020, 86977, 86977, 86977, 497, 330, 64, 7115, 298, 9859, 6611, 25, 330, 24812, 387, 2686, 1091, 5309, 5974, 756, 197, 197, 1583, 197, 197, 515, 298, 24395, 25, 262, 508, 17, 30953, 4913, 64, 497, 2917, 9020, 86977, 86977, 86977, 7115, 298, 9859, 6611, 25, 330, 24812, 387, 2686, 1091, 476, 6144, 311, 5309, 5974, 756, 197, 197, 1583, 197, 630, 2023, 600, 11, 272, 1669, 2088, 1273, 37302, 341, 197, 2405, 12789, 926, 610, 16650, 45791, 1900, 198, 197, 2233, 64, 1904, 2099, 64500, 16650, 54874, 1900, 90, 1900, 4047, 25, 926, 610, 16650, 9659, 4047, 515, 298, 55242, 25, 926, 610, 16650, 9610, 1337, 48369, 58, 15, 9719, 3972, 1592, 25, 926, 610, 16650, 9610, 1337, 48369, 58, 16, 17036, 197, 197, 71362, 197, 743, 8358, 1848, 1669, 16437, 1883, 64, 9659, 82, 1215, 753, 1944, 6031, 4506, 1454, 3964, 11, 272, 18441, 6611, 8, 341, 298, 3244, 13080, 4430, 67, 25, 16500, 1465, 1018, 85, 497, 600, 11, 1848, 340, 197, 197, 532, 197, 630, 197, 322, 3393, 264, 1142, 1380, 264, 2477, 30508, 1681, 702, 458, 835, 1376, 624, 2405, 12789, 926, 610, 16650, 45791, 1900, 198, 2233, 64, 1904, 2099, 64500, 16650, 2234, 1900, 90, 1900, 4047, 25, 926, 610, 16650, 9659, 4047, 515, 197, 55242, 25, 926, 610, 16650, 9610, 445, 64, 3975, 3972, 1592, 25, 926, 610, 16650, 9610, 445, 65, 4461, 197, 71362, 743, 8358, 1848, 1669, 16437, 1883, 64, 9659, 82, 1215, 753, 1944, 6031, 4506, 1454, 3964, 11, 330, 408, 1376, 5189, 369, 2477, 30508, 5666, 899, 341, 197, 3244, 13080, 445, 53859, 1465, 1018, 85, 497, 1848, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFKVSWithCustomKeySerializer(t *testing.T) { keySerializer := func(key interface{}) (string, error) { keyString, ok := key.(string) if !ok { return "", errors.New("converting key to string failed") } return filepath.Join(storePath, fmt.Sprintf("mypath/%s/valuefile", keyString)), nil } testFKVS(t, keySerializer) }
explode_data.jsonl/12215
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 123 }
[ 2830, 3393, 26998, 26050, 2354, 10268, 1592, 13909, 1155, 353, 8840, 836, 8, 341, 23634, 13909, 1669, 2915, 4857, 3749, 28875, 320, 917, 11, 1465, 8, 341, 197, 23634, 703, 11, 5394, 1669, 1376, 12832, 917, 340, 197, 743, 753, 562, 341, 298, 853, 7342, 5975, 7121, 445, 443, 49417, 1376, 311, 914, 4641, 1138, 197, 197, 532, 197, 853, 26054, 22363, 31200, 1820, 11, 8879, 17305, 445, 86134, 587, 12627, 82, 57542, 1192, 497, 1376, 703, 5731, 2092, 198, 197, 532, 18185, 26998, 26050, 1155, 11, 1376, 13909, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDecimalMul(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) tk.MustExec("USE test") tk.MustExec("create table t(a decimal(38, 17));") tk.MustExec("insert into t select 0.5999991229316*0.918755041726043;") res := tk.MustQuery("select * from t;") res.Check(testkit.Rows("0.55125221922461136")) }
explode_data.jsonl/65468
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 150 }
[ 2830, 3393, 11269, 59155, 1155, 353, 8840, 836, 8, 341, 57279, 11, 4240, 1669, 1273, 8226, 7251, 11571, 6093, 1155, 340, 16867, 4240, 2822, 3244, 74, 1669, 1273, 8226, 7121, 2271, 7695, 1155, 11, 3553, 340, 3244, 74, 50463, 10216, 445, 7910, 1273, 1138, 3244, 74, 50463, 10216, 445, 3182, 1965, 259, 2877, 12122, 7, 18, 23, 11, 220, 16, 22, 5905, 1138, 3244, 74, 50463, 10216, 445, 4208, 1119, 259, 3293, 220, 15, 13, 20, 24, 24, 24, 24, 24, 16, 17, 17, 24, 18, 16, 21, 9, 15, 13, 24, 16, 23, 22, 20, 20, 15, 19, 16, 22, 17, 21, 15, 19, 18, 91812, 10202, 1669, 17162, 50463, 2859, 445, 1742, 353, 504, 259, 91812, 10202, 10600, 8623, 8226, 11332, 445, 15, 13, 20, 20, 16, 17, 20, 17, 17, 16, 24, 17, 17, 19, 21, 16, 16, 18, 21, 5455, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAdoption(t *testing.T) { var trueVar = true testCases := []struct { name string existingOwnerReferences func(rs *v1beta1.ReplicaSet) []v1.OwnerReference expectedOwnerReferences func(rs *v1beta1.ReplicaSet) []v1.OwnerReference }{ { "pod refers rs as an owner, not a controller", func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{{UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet"}} }, func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{{UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}} }, }, { "pod doesn't have owner references", func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{} }, func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{{UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}} }, }, { "pod refers rs as a controller", func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{{UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}} }, func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{{UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}} }, }, { "pod refers other rs as the controller, refers the rs as an owner", func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{ {UID: "1", Name: "anotherRS", APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}, {UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet"}, } }, func(rs *v1beta1.ReplicaSet) []v1.OwnerReference { return []v1.OwnerReference{ {UID: "1", Name: "anotherRS", APIVersion: "extensions/v1beta1", Kind: "ReplicaSet", Controller: &trueVar}, {UID: rs.UID, Name: rs.Name, APIVersion: "extensions/v1beta1", Kind: "ReplicaSet"}, } }, }, } for i, tc := range testCases { s, rm, rsInformer, podInformer, clientSet := rmSetup(t, true) ns := framework.CreateTestingNamespace(fmt.Sprintf("rs-adoption-%d", i), s, t) defer framework.DeleteTestingNamespace(ns, s, t) rsClient := clientSet.Extensions().ReplicaSets(ns.Name) podClient := clientSet.Core().Pods(ns.Name) const rsName = "rs" rs, err := rsClient.Create(newRS(rsName, ns.Name, 1)) if err != nil { t.Fatalf("Failed to create replica set: %v", err) } podName := fmt.Sprintf("pod%d", i) pod := newMatchingPod(podName, ns.Name) pod.OwnerReferences = tc.existingOwnerReferences(rs) _, err = podClient.Create(pod) if err != nil { t.Fatalf("Failed to create Pod: %v", err) } stopCh := make(chan struct{}) go rsInformer.Run(stopCh) go podInformer.Run(stopCh) waitToObservePods(t, podInformer, 1) go rm.Run(5, stopCh) if err := wait.Poll(10*time.Second, 60*time.Second, func() (bool, error) { updatedPod, err := podClient.Get(pod.Name, metav1.GetOptions{}) if err != nil { return false, err } if e, a := tc.expectedOwnerReferences(rs), updatedPod.OwnerReferences; reflect.DeepEqual(e, a) { return true, nil } else { t.Logf("ownerReferences don't match, expect %v, got %v", e, a) return false, nil } }); err != nil { t.Fatal(err) } close(stopCh) } }
explode_data.jsonl/73258
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1465 }
[ 2830, 3393, 2589, 2047, 1155, 353, 8840, 836, 8, 341, 2405, 830, 3962, 284, 830, 198, 18185, 37302, 1669, 3056, 1235, 341, 197, 11609, 503, 914, 198, 197, 8122, 11083, 13801, 31712, 2915, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 198, 197, 42400, 13801, 31712, 2915, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 198, 197, 59403, 197, 197, 515, 298, 197, 1, 39073, 19257, 10036, 438, 458, 6372, 11, 537, 264, 6461, 756, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 2979, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 95642, 298, 197, 1583, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 2979, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 11248, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 197, 1, 39073, 3171, 944, 614, 6372, 15057, 756, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 16094, 298, 197, 1583, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 2979, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 11248, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 197, 1, 39073, 19257, 10036, 438, 264, 6461, 756, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 2979, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 11248, 298, 197, 1583, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 2979, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 11248, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 197, 1, 39073, 19257, 1008, 10036, 438, 279, 6461, 11, 19257, 279, 10036, 438, 458, 6372, 756, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 515, 464, 197, 90, 6463, 25, 330, 16, 497, 3988, 25, 330, 41963, 11451, 497, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 1583, 464, 197, 90, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 7115, 571, 197, 532, 298, 197, 1583, 298, 29244, 17027, 353, 85, 16, 19127, 16, 2817, 79, 15317, 1649, 8, 3056, 85, 16, 49920, 8856, 341, 571, 853, 3056, 85, 16, 49920, 8856, 515, 464, 197, 90, 6463, 25, 330, 16, 497, 3988, 25, 330, 41963, 11451, 497, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 497, 9771, 25, 609, 1866, 3962, 1583, 464, 197, 90, 6463, 25, 10036, 5255, 915, 11, 3988, 25, 10036, 2967, 11, 5333, 5637, 25, 330, 27609, 5457, 16, 19127, 16, 497, 16840, 25, 330, 18327, 15317, 1649, 7115, 571, 197, 532, 298, 197, 1583, 197, 197, 1583, 197, 532, 2023, 600, 11, 17130, 1669, 2088, 1273, 37302, 341, 197, 1903, 11, 18998, 11, 10036, 641, 34527, 11, 7509, 641, 34527, 11, 2943, 1649, 1669, 18998, 21821, 1155, 11, 830, 340, 197, 84041, 1669, 12626, 7251, 16451, 22699, 28197, 17305, 445, 5428, 25747, 2047, 11069, 67, 497, 600, 701, 274, 11, 259, 340, 197, 16867, 12626, 18872, 16451, 22699, 39417, 11, 274, 11, 259, 692, 197, 41231, 2959, 1669, 2943, 1649, 20526, 1005, 18327, 15317, 30175, 39417, 2967, 340, 197, 3223, 347, 2959, 1669, 2943, 1649, 12777, 1005, 23527, 82, 39417, 2967, 340, 197, 4777, 10036, 675, 284, 330, 5428, 698, 197, 41231, 11, 1848, 1669, 10036, 2959, 7251, 1755, 11451, 17027, 675, 11, 12268, 2967, 11, 220, 16, 1171, 197, 743, 1848, 961, 2092, 341, 298, 3244, 30762, 445, 9408, 311, 1855, 36954, 738, 25, 1018, 85, 497, 1848, 340, 197, 197, 532, 197, 3223, 347, 675, 1669, 8879, 17305, 445, 39073, 14841, 497, 600, 340, 197, 3223, 347, 1669, 501, 64430, 23527, 1295, 347, 675, 11, 12268, 2967, 340, 197, 3223, 347, 49920, 31712, 284, 17130, 2223, 11083, 13801, 31712, 17027, 340, 197, 197, 6878, 1848, 284, 7509, 2959, 7251, 1295, 347, 340, 197, 743, 1848, 961, 2092, 341, 298, 3244, 30762, 445, 9408, 311, 1855, 16821, 25, 1018, 85, 497, 1848, 340, 197, 197, 630, 197, 62644, 1143, 1669, 1281, 35190, 2036, 37790, 197, 30680, 10036, 641, 34527, 16708, 60170, 1143, 340, 197, 30680, 7509, 641, 34527, 16708, 60170, 1143, 340, 197, 48750, 1249, 4121, 13267, 23527, 82, 1155, 11, 7509, 641, 34527, 11, 220, 16, 340, 197, 30680, 18998, 16708, 7, 20, 11, 2936, 1143, 340, 197, 743, 1848, 1669, 3783, 1069, 965, 7, 16, 15, 77053, 32435, 11, 220, 21, 15, 77053, 32435, 11, 2915, 368, 320, 2641, 11, 1465, 8, 341, 298, 197, 11768, 23527, 11, 1848, 1669, 7509, 2959, 2234, 1295, 347, 2967, 11, 77520, 16, 2234, 3798, 37790, 298, 743, 1848, 961, 2092, 341, 571, 853, 895, 11, 1848, 198, 298, 197, 532, 298, 743, 384, 11, 264, 1669, 17130, 56835, 13801, 31712, 17027, 701, 6049, 23527, 49920, 31712, 26, 8708, 94750, 2026, 11, 264, 8, 341, 571, 853, 830, 11, 2092, 198, 298, 197, 92, 770, 341, 571, 3244, 98954, 445, 8118, 31712, 1513, 944, 2432, 11, 1720, 1018, 85, 11, 2684, 1018, 85, 497, 384, 11, 264, 340, 571, 853, 895, 11, 2092, 198, 298, 197, 532, 197, 197, 14088, 1848, 961, 2092, 341, 298, 3244, 26133, 3964, 340, 197, 197, 532, 197, 27873, 60170, 1143, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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.T) { dir, err := createFiles([]fileSpec{ {path: "WORKSPACE", content: ""}, }) if err != nil { t.Fatal(err) } want := "-go_prefix not set" if err := runGazelle(dir, nil); err == nil { t.Fatalf("got success; want %q", want) } else if !strings.Contains(err.Error(), want) { t.Fatalf("got %q; want %q", err, want) } }
explode_data.jsonl/40383
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 157 }
[ 2830, 3393, 2753, 10850, 14335, 2735, 2195, 11337, 1155, 353, 8840, 836, 8, 341, 48532, 11, 1848, 1669, 1855, 10809, 10556, 1192, 8327, 515, 197, 197, 90, 2343, 25, 330, 18470, 44641, 497, 2213, 25, 77496, 197, 3518, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 50780, 1669, 6523, 3346, 13974, 537, 738, 698, 743, 1848, 1669, 1598, 38, 1370, 6712, 14161, 11, 2092, 1215, 1848, 621, 2092, 341, 197, 3244, 30762, 445, 22390, 2393, 26, 1366, 1018, 80, 497, 1366, 340, 197, 92, 770, 421, 753, 18594, 11545, 3964, 6141, 1507, 1366, 8, 341, 197, 3244, 30762, 445, 22390, 1018, 80, 26, 1366, 1018, 80, 497, 1848, 11, 1366, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMetricsServiceV2GetLogMetricError(t *testing.T) { errCode := codes.Internal mockMetrics.err = grpc.Errorf(errCode, "test error") var formattedMetricName string = MetricsMetricPath("[PROJECT]", "[METRIC]") var request = &loggingpb.GetLogMetricRequest{ MetricName: formattedMetricName, } c, err := NewMetricsClient(context.Background(), clientOpt) if err != nil { t.Fatal(err) } resp, err := c.GetLogMetric(context.Background(), request) if c := grpc.Code(err); c != errCode { t.Errorf("got error code %q, want %q", c, errCode) } _ = resp }
explode_data.jsonl/77780
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 213 }
[ 2830, 3393, 27328, 1860, 53, 17, 1949, 2201, 54310, 1454, 1155, 353, 8840, 836, 8, 341, 9859, 2078, 1669, 13912, 32579, 198, 77333, 27328, 18441, 284, 47900, 13080, 3964, 2078, 11, 330, 1944, 1465, 5130, 2405, 23126, 54310, 675, 914, 284, 54190, 54310, 1820, 10937, 41455, 19076, 10545, 44875, 35978, 47915, 2405, 1681, 284, 609, 25263, 16650, 2234, 2201, 54310, 1900, 515, 197, 9209, 16340, 675, 25, 23126, 54310, 675, 345, 197, 630, 1444, 11, 1848, 1669, 1532, 27328, 2959, 5378, 19047, 1507, 2943, 21367, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 34653, 11, 1848, 1669, 272, 2234, 2201, 54310, 5378, 19047, 1507, 1681, 692, 743, 272, 1669, 47900, 20274, 3964, 1215, 272, 961, 1848, 2078, 341, 197, 3244, 13080, 445, 22390, 1465, 2038, 1018, 80, 11, 1366, 1018, 80, 497, 272, 11, 1848, 2078, 340, 197, 532, 197, 62, 284, 9039, 198, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCyclomatic(t *testing.T) { testRule(t, "cyclomatic", &rule.CyclomaticRule{}, &lint.RuleConfig{ Arguments: []interface{}{int64(1)}, }) testRule(t, "cyclomatic-2", &rule.CyclomaticRule{}, &lint.RuleConfig{ Arguments: []interface{}{int64(3)}, }) }
explode_data.jsonl/32421
{ "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, 34, 6179, 13487, 1155, 353, 8840, 836, 8, 341, 18185, 11337, 1155, 11, 330, 97484, 13487, 497, 609, 12937, 727, 6179, 13487, 11337, 22655, 609, 14957, 63961, 2648, 515, 197, 197, 19139, 25, 3056, 4970, 6257, 90, 396, 21, 19, 7, 16, 39781, 197, 3518, 18185, 11337, 1155, 11, 330, 97484, 13487, 12, 17, 497, 609, 12937, 727, 6179, 13487, 11337, 22655, 609, 14957, 63961, 2648, 515, 197, 197, 19139, 25, 3056, 4970, 6257, 90, 396, 21, 19, 7, 18, 39781, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestListenerFilter_Verify(t *testing.T) { tests := []struct { desc string inFilter *ListenerFilter inListener *listener.Listener expect bool }{ { desc: "filter-fields-empty", inFilter: &ListenerFilter{ Address: "", Port: 0, Type: "", }, inListener: &listener.Listener{}, expect: true, }, { desc: "addrs-dont-match", inFilter: &ListenerFilter{ Address: "0.0.0.0", }, inListener: &listener.Listener{ Address: &v3.Address{ Address: &v3.Address_SocketAddress{ SocketAddress: &v3.SocketAddress{Address: "1.1.1.1"}, }, }, }, expect: false, }, { desc: "ports-dont-match", inFilter: &ListenerFilter{ Port: 10, }, inListener: &listener.Listener{ Address: &v3.Address{ Address: &v3.Address_SocketAddress{ SocketAddress: &v3.SocketAddress{ PortSpecifier: &v3.SocketAddress_PortValue{ PortValue: 11, }, }, }, }, }, expect: false, }, { desc: "http-type-match", inFilter: &ListenerFilter{ Type: "HTTP", }, inListener: &listener.Listener{ FilterChains: []*listener.FilterChain{ { Filters: []*listener.Filter{ { Name: wellknown.HTTPConnectionManager, }, }, }, }, }, expect: true, }, { desc: "http-tcp-type-match", inFilter: &ListenerFilter{ Type: "HTTP+TCP", }, inListener: &listener.Listener{ FilterChains: []*listener.FilterChain{{ Filters: []*listener.Filter{ { Name: wellknown.TCPProxy, }, { Name: wellknown.TCPProxy, }, { Name: wellknown.HTTPConnectionManager, }, }, }}, }, expect: true, }, { desc: "tcp-type-match", inFilter: &ListenerFilter{ Type: "TCP", }, inListener: &listener.Listener{ FilterChains: []*listener.FilterChain{{ Filters: []*listener.Filter{{ Name: wellknown.TCPProxy, }}, }}, }, expect: true, }, { desc: "unknown-type", inFilter: &ListenerFilter{ Type: "UNKNOWN", }, inListener: &listener.Listener{ FilterChains: []*listener.FilterChain{{ Filters: []*listener.Filter{}, }}, }, expect: true, }, { desc: "listener-pipe", inFilter: &ListenerFilter{ Address: "", Port: 0, Type: "", }, inListener: &listener.Listener{ Address: &v3.Address{ Address: &v3.Address_Pipe{ Pipe: &v3.Pipe{Path: "unix:///dev/shm/uds.socket"}, }, }, }, expect: true, }, } for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { if got := tt.inFilter.Verify(tt.inListener); got != tt.expect { t.Errorf("%s: expect %v got %v", tt.desc, tt.expect, got) } }) } }
explode_data.jsonl/60718
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1437 }
[ 2830, 3393, 2743, 5632, 2334, 261, 1437, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 41653, 981, 914, 198, 197, 17430, 5632, 256, 353, 2743, 5632, 198, 197, 17430, 2743, 353, 35039, 64091, 198, 197, 24952, 257, 1807, 198, 197, 59403, 197, 197, 515, 298, 41653, 25, 330, 5315, 79585, 39433, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 98090, 25, 8324, 571, 98459, 25, 262, 220, 15, 345, 571, 27725, 25, 262, 8324, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 38837, 298, 24952, 25, 257, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 718, 5428, 1737, 544, 45704, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 98090, 25, 330, 15, 13, 15, 13, 15, 13, 15, 756, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 98090, 25, 609, 85, 18, 26979, 515, 464, 98090, 25, 609, 85, 18, 26979, 1098, 4537, 4286, 515, 1144, 7568, 4537, 4286, 25, 609, 85, 18, 52089, 4286, 90, 4286, 25, 330, 16, 13, 16, 13, 16, 13, 16, 7115, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 3394, 1737, 544, 45704, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 98459, 25, 220, 16, 15, 345, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 98090, 25, 609, 85, 18, 26979, 515, 464, 98090, 25, 609, 85, 18, 26979, 1098, 4537, 4286, 515, 1144, 7568, 4537, 4286, 25, 609, 85, 18, 52089, 4286, 515, 1662, 98459, 87297, 25, 609, 85, 18, 52089, 4286, 56328, 1130, 515, 2683, 98459, 1130, 25, 220, 16, 16, 345, 1662, 197, 1583, 1144, 197, 1583, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 1254, 10604, 45704, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 27725, 25, 330, 9230, 756, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 197, 5632, 1143, 1735, 25, 29838, 35039, 31696, 18837, 515, 464, 197, 515, 1144, 12727, 8612, 25, 29838, 35039, 31696, 515, 1662, 197, 515, 2683, 21297, 25, 1632, 5278, 27358, 4526, 2043, 345, 1662, 197, 1583, 1144, 197, 1583, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 1254, 2385, 4672, 10604, 45704, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 27725, 25, 330, 9230, 10, 49896, 756, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 197, 5632, 1143, 1735, 25, 29838, 35039, 31696, 18837, 90, 515, 464, 12727, 8612, 25, 29838, 35039, 31696, 515, 1144, 197, 515, 1662, 21297, 25, 1632, 5278, 836, 7123, 16219, 345, 1144, 197, 1583, 1144, 197, 515, 1662, 21297, 25, 1632, 5278, 836, 7123, 16219, 345, 1144, 197, 1583, 1144, 197, 515, 1662, 21297, 25, 1632, 5278, 27358, 4526, 2043, 345, 1144, 197, 1583, 464, 197, 1583, 571, 197, 22050, 298, 197, 1583, 298, 24952, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 27161, 10604, 45704, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 27725, 25, 330, 49896, 756, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 197, 5632, 1143, 1735, 25, 29838, 35039, 31696, 18837, 90, 515, 464, 12727, 8612, 25, 29838, 35039, 31696, 90, 515, 1144, 21297, 25, 1632, 5278, 836, 7123, 16219, 345, 464, 197, 22050, 571, 197, 22050, 298, 197, 1583, 298, 24952, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 16088, 10604, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 27725, 25, 330, 51378, 756, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 197, 5632, 1143, 1735, 25, 29838, 35039, 31696, 18837, 90, 515, 464, 12727, 8612, 25, 29838, 35039, 31696, 38837, 571, 197, 22050, 298, 197, 1583, 298, 24952, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 41653, 25, 330, 35039, 2268, 3444, 756, 298, 17430, 5632, 25, 609, 2743, 5632, 515, 571, 98090, 25, 8324, 571, 98459, 25, 262, 220, 15, 345, 571, 27725, 25, 262, 8324, 298, 197, 1583, 298, 17430, 2743, 25, 609, 35039, 64091, 515, 571, 98090, 25, 609, 85, 18, 26979, 515, 464, 98090, 25, 609, 85, 18, 26979, 1088, 3444, 515, 1144, 10025, 3444, 25, 609, 85, 18, 1069, 3444, 90, 1820, 25, 330, 56646, 60896, 3583, 14688, 76, 14, 27988, 25926, 7115, 464, 197, 1583, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 830, 345, 197, 197, 1583, 197, 630, 2023, 8358, 17853, 1669, 2088, 7032, 341, 197, 3244, 16708, 47152, 30514, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 743, 2684, 1669, 17853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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestConnect(t *testing.T) { t.Parallel() connString := os.Getenv("PGX_TEST_DATABASE") config := mustParseConfig(t, connString) conn, err := pgx.ConnectConfig(context.Background(), config) if err != nil { t.Fatalf("Unable to establish connection: %v", err) } assertConfigsEqual(t, config, conn.Config(), "Conn.Config() returns original config") var currentDB string err = conn.QueryRow(context.Background(), "select current_database()").Scan(&currentDB) if err != nil { t.Fatalf("QueryRow Scan unexpectedly failed: %v", err) } if currentDB != config.Config.Database { t.Errorf("Did not connect to specified database (%v)", config.Config.Database) } var user string err = conn.QueryRow(context.Background(), "select current_user").Scan(&user) if err != nil { t.Fatalf("QueryRow Scan unexpectedly failed: %v", err) } if user != config.Config.User { t.Errorf("Did not connect as specified user (%v)", config.Config.User) } err = conn.Close(context.Background()) if err != nil { t.Fatal("Unable to close connection") } }
explode_data.jsonl/39996
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 355 }
[ 2830, 3393, 14611, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 2822, 32917, 703, 1669, 2643, 64883, 445, 11383, 55, 11641, 45510, 1138, 25873, 1669, 1969, 14463, 2648, 1155, 11, 4534, 703, 692, 32917, 11, 1848, 1669, 17495, 87, 43851, 2648, 5378, 19047, 1507, 2193, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 17075, 311, 5695, 3633, 25, 1018, 85, 497, 1848, 340, 197, 630, 6948, 84905, 2993, 1155, 11, 2193, 11, 4534, 10753, 1507, 330, 9701, 10753, 368, 4675, 4024, 2193, 5130, 2405, 1482, 3506, 914, 198, 9859, 284, 4534, 15685, 3102, 5378, 19047, 1507, 330, 1742, 1482, 27341, 368, 1827, 26570, 2099, 3231, 3506, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 2859, 3102, 31108, 50609, 4641, 25, 1018, 85, 497, 1848, 340, 197, 532, 743, 1482, 3506, 961, 2193, 10753, 25008, 341, 197, 3244, 13080, 445, 6986, 537, 4564, 311, 5189, 4625, 13456, 85, 11583, 2193, 10753, 25008, 340, 197, 630, 2405, 1196, 914, 198, 9859, 284, 4534, 15685, 3102, 5378, 19047, 1507, 330, 1742, 1482, 3317, 1827, 26570, 2099, 872, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 2859, 3102, 31108, 50609, 4641, 25, 1018, 85, 497, 1848, 340, 197, 532, 743, 1196, 961, 2193, 10753, 7344, 341, 197, 3244, 13080, 445, 6986, 537, 4564, 438, 5189, 1196, 13456, 85, 11583, 2193, 10753, 7344, 340, 197, 630, 9859, 284, 4534, 10421, 5378, 19047, 2398, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 445, 17075, 311, 3265, 3633, 1138, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
7
func TestSourceStatus_GetErrors(t *testing.T) { t.Run("None", func(t *testing.T) { x := SourceStatus{} assert.Equal(t, uint64(0), x.GetErrors()) }) t.Run("NotRecent", func(t *testing.T) { x := SourceStatus{ LastError: &Error{Time: metav1.Time{}}, Metrics: map[string]Metrics{"": {Errors: 1}}, } assert.Equal(t, uint64(1), x.GetErrors()) assert.False(t, x.RecentErrors()) }) t.Run("Recent", func(t *testing.T) { x := SourceStatus{ LastError: &Error{Time: metav1.Now()}, Metrics: map[string]Metrics{"": {Errors: 1}}, } assert.Equal(t, uint64(1), x.GetErrors()) assert.True(t, x.RecentErrors()) }) }
explode_data.jsonl/49606
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 292 }
[ 2830, 3393, 3608, 2522, 13614, 13877, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 4064, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 10225, 1669, 8748, 2522, 16094, 197, 6948, 12808, 1155, 11, 2622, 21, 19, 7, 15, 701, 856, 2234, 13877, 2398, 197, 3518, 3244, 16708, 445, 2623, 25140, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 10225, 1669, 8748, 2522, 515, 298, 197, 35572, 25, 609, 1454, 90, 1462, 25, 77520, 16, 16299, 6257, 1583, 298, 9209, 13468, 25, 256, 2415, 14032, 60, 27328, 4913, 788, 314, 13877, 25, 220, 16, 22050, 197, 197, 532, 197, 6948, 12808, 1155, 11, 2622, 21, 19, 7, 16, 701, 856, 2234, 13877, 2398, 197, 6948, 50757, 1155, 11, 856, 2817, 1168, 13877, 2398, 197, 3518, 3244, 16708, 445, 25140, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 10225, 1669, 8748, 2522, 515, 298, 197, 35572, 25, 609, 1454, 90, 1462, 25, 77520, 16, 13244, 78108, 298, 9209, 13468, 25, 256, 2415, 14032, 60, 27328, 4913, 788, 314, 13877, 25, 220, 16, 22050, 197, 197, 532, 197, 6948, 12808, 1155, 11, 2622, 21, 19, 7, 16, 701, 856, 2234, 13877, 2398, 197, 6948, 32443, 1155, 11, 856, 2817, 1168, 13877, 2398, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetSetIP6(t *testing.T) { ip := IP6{0x20, 0x01, 0x48, 0x60, 0, 0, 0x20, 0x01, 0, 0, 0, 0, 0, 0, 0x00, 0x68} var r Record r.Set(ip) var ip2 IP6 require.NoError(t, r.Load(&ip2)) assert.Equal(t, ip, ip2) }
explode_data.jsonl/39486
{ "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, 1949, 1649, 3298, 21, 1155, 353, 8840, 836, 8, 341, 46531, 1669, 6790, 21, 90, 15, 87, 17, 15, 11, 220, 15, 87, 15, 16, 11, 220, 15, 87, 19, 23, 11, 220, 15, 87, 21, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 87, 17, 15, 11, 220, 15, 87, 15, 16, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 87, 15, 15, 11, 220, 15, 87, 21, 23, 532, 2405, 435, 13583, 198, 7000, 4202, 23443, 692, 2405, 5997, 17, 6790, 21, 198, 17957, 35699, 1155, 11, 435, 13969, 2099, 573, 17, 1171, 6948, 12808, 1155, 11, 5997, 11, 5997, 17, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMutateTime(t *testing.T) { source := sourceImage(t) want := time.Time{} result, err := mutate.Time(source, want) if err != nil { t.Fatalf("failed to mutate a config: %v", err) } if configDigestsAreEqual(t, source, result) { t.Fatal("mutating the created time MUST mutate the config digest") } got := getConfigFile(t, result).Created.Time if got != want { t.Fatalf("mutating the created time MUST mutate the time from %v to %v", got, want) } }
explode_data.jsonl/3096
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 172 }
[ 2830, 3393, 51440, 349, 1462, 1155, 353, 8840, 836, 8, 341, 47418, 1669, 2530, 1906, 1155, 340, 50780, 1669, 882, 16299, 16094, 9559, 11, 1848, 1669, 67182, 16299, 12437, 11, 1366, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 16091, 311, 67182, 264, 2193, 25, 1018, 85, 497, 1848, 340, 197, 630, 743, 2193, 45217, 82, 11526, 2993, 1155, 11, 2530, 11, 1102, 8, 341, 197, 3244, 26133, 445, 6984, 1095, 279, 3465, 882, 27732, 67182, 279, 2193, 20882, 1138, 197, 630, 3174, 354, 1669, 66763, 1703, 1155, 11, 1102, 568, 11694, 16299, 198, 743, 2684, 961, 1366, 341, 197, 3244, 30762, 445, 6984, 1095, 279, 3465, 882, 27732, 67182, 279, 882, 504, 1018, 85, 311, 1018, 85, 497, 2684, 11, 1366, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPairEscrowAddress(t *testing.T) { for _, tc := range []struct { pairId uint64 expected string }{ {1, "cosmos17u9nx0h9cmhypp6cg9lf4q8ku9l3k8mz232su7m28m39lkz25dgqzkypxs"}, {2, "cosmos1dsm56ejte5wsvptgtlq8qy3qvw6vpgz8w3z77f7cyjkmayzq3fxsdtsn2d"}, } { t.Run("", func(t *testing.T) { require.Equal(t, tc.expected, types.PairEscrowAddress(tc.pairId).String()) }) } }
explode_data.jsonl/7246
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 212 }
[ 2830, 3393, 12443, 36121, 651, 4286, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 17130, 1669, 2088, 3056, 1235, 341, 197, 3223, 1310, 764, 256, 2622, 21, 19, 198, 197, 42400, 914, 198, 197, 59403, 197, 197, 90, 16, 11, 330, 9407, 8631, 16, 22, 84, 24, 23357, 15, 71, 24, 6226, 8503, 602, 21, 27446, 24, 11008, 19, 80, 23, 12133, 24, 75, 18, 74, 23, 76, 89, 17, 18, 17, 27051, 22, 76, 17, 23, 76, 18, 24, 41748, 89, 17, 20, 35138, 80, 40696, 1082, 18561, 7115, 197, 197, 90, 17, 11, 330, 9407, 8631, 16, 67, 3563, 20, 21, 35468, 665, 20, 86, 3492, 417, 5178, 75, 80, 23, 80, 88, 18, 80, 34431, 21, 85, 3517, 89, 23, 86, 18, 89, 22, 22, 69, 22, 11130, 73, 16017, 352, 89, 80, 18, 8298, 13446, 2576, 77, 17, 67, 7115, 197, 92, 341, 197, 3244, 16708, 19814, 2915, 1155, 353, 8840, 836, 8, 341, 298, 17957, 12808, 1155, 11, 17130, 56835, 11, 4494, 1069, 1310, 36121, 651, 4286, 44415, 95955, 764, 568, 703, 2398, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSqrt2HighPrecision(t *testing.T) { prec := uint(100/math.Log10(2)) + 1 // 100 decimal digits x := new(big.Float).SetPrec(prec).SetInt64(2) out := new(big.Float).SetPrec(prec) pslq := New(prec) pslq.Sqrt(x, out) result := fmt.Sprintf("%.100f", out) expected := "1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727" if result != expected { t.Errorf("100 digits of Sqrt(2) wrong\nExpected %q\nActual %q", expected, result) } }
explode_data.jsonl/66839
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 220 }
[ 2830, 3393, 50, 8140, 17, 11976, 55501, 1155, 353, 8840, 836, 8, 341, 197, 10645, 1669, 2622, 7, 16, 15, 15, 59705, 5247, 16, 15, 7, 17, 593, 488, 220, 16, 442, 220, 16, 15, 15, 12122, 18509, 198, 10225, 1669, 501, 75616, 29794, 568, 1649, 68833, 1295, 2758, 568, 1649, 1072, 21, 19, 7, 17, 340, 13967, 1669, 501, 75616, 29794, 568, 1649, 68833, 1295, 2758, 340, 35009, 75, 80, 1669, 1532, 1295, 2758, 340, 35009, 75, 80, 70815, 2075, 11, 700, 340, 9559, 1669, 8879, 17305, 48949, 16, 15, 15, 69, 497, 700, 340, 42400, 1669, 330, 16, 13, 19, 16, 19, 17, 16, 18, 20, 21, 17, 18, 22, 18, 15, 24, 20, 15, 19, 23, 23, 15, 16, 21, 23, 23, 22, 17, 19, 17, 15, 24, 21, 24, 23, 15, 22, 23, 20, 21, 24, 21, 22, 16, 23, 22, 20, 18, 22, 21, 24, 19, 23, 15, 22, 18, 16, 22, 21, 21, 22, 24, 22, 18, 22, 24, 24, 15, 22, 18, 17, 19, 22, 23, 19, 21, 17, 16, 15, 22, 15, 18, 23, 23, 20, 15, 18, 23, 22, 20, 18, 19, 18, 17, 22, 21, 19, 16, 20, 22, 17, 22, 698, 743, 1102, 961, 3601, 341, 197, 3244, 13080, 445, 16, 15, 15, 18509, 315, 328, 8140, 7, 17, 8, 4969, 1699, 18896, 1018, 80, 1699, 28123, 256, 1018, 80, 497, 3601, 11, 1102, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUnsupportedMethod(t *testing.T) { router := MakeRouter() router.GET("/zello/yes", printHello) router.GET("/hello", printHello) router.GET("/activity/:user", writeData) RunRequest(router, "HEAD", "/activity/", 405, "Method Not Allowed", t) }
explode_data.jsonl/15101
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 94 }
[ 2830, 3393, 41884, 3523, 1155, 353, 8840, 836, 8, 1476, 67009, 1669, 7405, 9523, 741, 67009, 17410, 4283, 89, 4791, 14, 9693, 497, 1173, 9707, 340, 67009, 17410, 4283, 14990, 497, 1173, 9707, 340, 67009, 17410, 4283, 7175, 11315, 872, 497, 3270, 1043, 692, 85952, 1900, 61210, 11, 330, 35433, 497, 3521, 7175, 28105, 220, 19, 15, 20, 11, 330, 3523, 2806, 57622, 497, 259, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRemovePathIfPresent(t *testing.T) { for _, tt := range []struct { input string expected string }{ {input: "http://foo.com", expected: "http://foo.com"}, {input: "http://foo.com/", expected: "http://foo.com"}, {input: "http://foo.com/api/v1", expected: "http://foo.com"}, {input: "http://foo.com?foo", expected: "http://foo.com"}, {input: "http://foo.com/api/v1/?foo", expected: "http://foo.com"}, {input: "http://foo.com/api/v1?foo", expected: "http://foo.com"}, {input: "http://foo.com:8080", expected: "http://foo.com:8080"}, {input: "http://foo.com:8080/", expected: "http://foo.com:8080"}, {input: "http://foo.com:8080/api/v1", expected: "http://foo.com:8080"}, } { u, err := url.Parse(tt.input) require.NoError(t, err) assert.Equal(t, tt.expected, removePathIfPresent(u)) } }
explode_data.jsonl/50776
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 345 }
[ 2830, 3393, 13021, 1820, 2679, 21195, 1155, 353, 8840, 836, 8, 341, 2023, 8358, 17853, 1669, 2088, 3056, 1235, 341, 197, 22427, 262, 914, 198, 197, 42400, 914, 198, 197, 59403, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 28105, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 10508, 5457, 16, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 30, 7975, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 10508, 5457, 16, 17763, 7975, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 10508, 5457, 16, 30, 7975, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 28105, 3601, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 7115, 197, 197, 90, 1355, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 10508, 5457, 16, 497, 3601, 25, 330, 1254, 1110, 7975, 905, 25, 23, 15, 23, 15, 7115, 197, 92, 341, 197, 10676, 11, 1848, 1669, 2515, 8937, 47152, 10046, 340, 197, 17957, 35699, 1155, 11, 1848, 692, 197, 6948, 12808, 1155, 11, 17853, 56835, 11, 4057, 1820, 2679, 21195, 8154, 1171, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestWorkerWait(t *testing.T) { db, cleanup := storageTestEnv(t) defer cleanup() ctx := context.Background() executor := &mockExecutor{t: t, dependencies: NewDependencyManager()} worker := newWorker(db, executor, &testPublisherProvider{}) reporter := statusReporterFunc(func(ctx context.Context, taskID string, status *api.TaskStatus) error { log.G(ctx).WithFields(logrus.Fields{"task.id": taskID, "status": status}).Info("status update received") return nil }) worker.Listen(ctx, reporter) changeSet := []*api.AssignmentChange{ { Assignment: &api.Assignment{ Item: &api.Assignment_Task{ Task: &api.Task{ID: "task-1"}, }, }, Action: api.AssignmentChange_AssignmentActionUpdate, }, { Assignment: &api.Assignment{ Item: &api.Assignment_Task{ Task: &api.Task{ID: "task-2"}, }, }, Action: api.AssignmentChange_AssignmentActionUpdate, }, { Assignment: &api.Assignment{ Item: &api.Assignment_Secret{ Secret: &api.Secret{ID: "secret-1"}, }, }, Action: api.AssignmentChange_AssignmentActionUpdate, }, { Assignment: &api.Assignment{ Item: &api.Assignment_Config{ Config: &api.Config{ID: "config-1"}, }, }, Action: api.AssignmentChange_AssignmentActionUpdate, }, } expectedTasks := []*api.Task{ {ID: "task-1"}, {ID: "task-2"}, } expectedSecrets := []*api.Secret{ {ID: "secret-1"}, } expectedConfigs := []*api.Config{ {ID: "config-1"}, } expectedAssigned := []*api.Task{ {ID: "task-1"}, {ID: "task-2"}, } var ( tasks []*api.Task assigned []*api.Task ) assert.NoError(t, worker.Assign(ctx, changeSet)) assert.NoError(t, worker.db.View(func(tx *bolt.Tx) error { return WalkTasks(tx, func(task *api.Task) error { tasks = append(tasks, task) if TaskAssigned(tx, task.ID) { assigned = append(assigned, task) } return nil }) })) assert.Equal(t, expectedTasks, tasks) assert.Equal(t, expectedAssigned, assigned) for _, secret := range expectedSecrets { secret, err := executor.Secrets().Get(secret.ID) assert.NoError(t, err) assert.NotNil(t, secret) } for _, config := range expectedConfigs { config, err := executor.Configs().Get(config.ID) assert.NoError(t, err) assert.NotNil(t, config) } err := worker.Assign(ctx, nil) assert.Nil(t, err) err = worker.Wait(ctx) assert.Nil(t, err) assigned = assigned[:0] assert.NoError(t, worker.db.View(func(tx *bolt.Tx) error { return WalkTasks(tx, func(task *api.Task) error { if TaskAssigned(tx, task.ID) { assigned = append(assigned, task) } return nil }) })) assert.Equal(t, len(assigned), 0) }
explode_data.jsonl/11418
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1122 }
[ 2830, 3393, 21936, 14190, 1155, 353, 8840, 836, 8, 341, 20939, 11, 21290, 1669, 5819, 2271, 14359, 1155, 340, 16867, 21290, 2822, 20985, 1669, 2266, 19047, 741, 67328, 4831, 1669, 609, 16712, 25255, 90, 83, 25, 259, 11, 19543, 25, 1532, 36387, 2043, 23509, 197, 21462, 1669, 501, 21936, 9791, 11, 31558, 11, 609, 1944, 34550, 5179, 37790, 69931, 261, 1669, 2639, 52766, 9626, 18552, 7502, 2266, 9328, 11, 3383, 915, 914, 11, 2639, 353, 2068, 28258, 2522, 8, 1465, 341, 197, 6725, 1224, 7502, 568, 2354, 8941, 12531, 20341, 42809, 4913, 8202, 1764, 788, 3383, 915, 11, 330, 2829, 788, 2639, 16630, 1731, 445, 2829, 2647, 3949, 1138, 197, 853, 2092, 198, 197, 8824, 197, 21462, 68334, 7502, 11, 18960, 692, 68380, 1649, 1669, 29838, 2068, 10871, 3531, 4072, 515, 197, 197, 515, 298, 197, 41613, 25, 609, 2068, 10871, 3531, 515, 571, 61574, 25, 609, 2068, 10871, 3531, 77103, 515, 464, 81153, 25, 609, 2068, 28258, 90, 915, 25, 330, 8202, 12, 16, 7115, 571, 197, 1583, 298, 197, 1583, 298, 67607, 25, 6330, 10871, 3531, 4072, 62222, 3531, 2512, 4289, 345, 197, 197, 1583, 197, 197, 515, 298, 197, 41613, 25, 609, 2068, 10871, 3531, 515, 571, 61574, 25, 609, 2068, 10871, 3531, 77103, 515, 464, 81153, 25, 609, 2068, 28258, 90, 915, 25, 330, 8202, 12, 17, 7115, 571, 197, 1583, 298, 197, 1583, 298, 67607, 25, 6330, 10871, 3531, 4072, 62222, 3531, 2512, 4289, 345, 197, 197, 1583, 197, 197, 515, 298, 197, 41613, 25, 609, 2068, 10871, 3531, 515, 571, 61574, 25, 609, 2068, 10871, 3531, 1098, 50856, 515, 464, 7568, 50856, 25, 609, 2068, 74779, 90, 915, 25, 330, 20474, 12, 16, 7115, 571, 197, 1583, 298, 197, 1583, 298, 67607, 25, 6330, 10871, 3531, 4072, 62222, 3531, 2512, 4289, 345, 197, 197, 1583, 197, 197, 515, 298, 197, 41613, 25, 609, 2068, 10871, 3531, 515, 571, 61574, 25, 609, 2068, 10871, 3531, 35412, 515, 464, 66156, 25, 609, 2068, 10753, 90, 915, 25, 330, 1676, 12, 16, 7115, 571, 197, 1583, 298, 197, 1583, 298, 67607, 25, 6330, 10871, 3531, 4072, 62222, 3531, 2512, 4289, 345, 197, 197, 1583, 197, 630, 42400, 25449, 1669, 29838, 2068, 28258, 515, 197, 197, 90, 915, 25, 330, 8202, 12, 16, 7115, 197, 197, 90, 915, 25, 330, 8202, 12, 17, 7115, 197, 630, 42400, 19773, 82, 1669, 29838, 2068, 74779, 515, 197, 197, 90, 915, 25, 330, 20474, 12, 16, 7115, 197, 630, 42400, 84905, 1669, 29838, 2068, 10753, 515, 197, 197, 90, 915, 25, 330, 1676, 12, 16, 7115, 197, 630, 42400, 94025, 1669, 29838, 2068, 28258, 515, 197, 197, 90, 915, 25, 330, 8202, 12, 16, 7115, 197, 197, 90, 915, 25, 330, 8202, 12, 17, 7115, 197, 630, 2405, 2399, 197, 3244, 4604, 262, 29838, 2068, 28258, 198, 197, 197, 39021, 29838, 2068, 28258, 198, 197, 340, 6948, 35699, 1155, 11, 11864, 86971, 7502, 11, 2297, 1649, 4390, 6948, 35699, 1155, 11, 11864, 7076, 6382, 18552, 27301, 353, 52433, 81362, 8, 1465, 341, 197, 853, 12554, 25449, 27301, 11, 2915, 17483, 353, 2068, 28258, 8, 1465, 341, 298, 3244, 4604, 284, 8737, 70339, 11, 3383, 340, 298, 743, 5430, 94025, 27301, 11, 3383, 9910, 8, 341, 571, 197, 39021, 284, 8737, 7, 39021, 11, 3383, 340, 298, 197, 532, 298, 853, 2092, 198, 197, 197, 3518, 197, 93596, 6948, 12808, 1155, 11, 3601, 25449, 11, 9079, 340, 6948, 12808, 1155, 11, 3601, 94025, 11, 12607, 340, 2023, 8358, 6234, 1669, 2088, 3601, 19773, 82, 341, 197, 197, 20474, 11, 1848, 1669, 31558, 74779, 82, 1005, 1949, 75862, 9910, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 93882, 1155, 11, 6234, 340, 197, 532, 2023, 8358, 2193, 1669, 2088, 3601, 84905, 341, 197, 25873, 11, 1848, 1669, 31558, 10753, 82, 1005, 1949, 8754, 9910, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 93882, 1155, 11, 2193, 340, 197, 630, 9859, 1669, 11864, 86971, 7502, 11, 2092, 340, 6948, 59678, 1155, 11, 1848, 692, 9859, 284, 11864, 28384, 7502, 340, 6948, 59678, 1155, 11, 1848, 692, 197, 39021, 284, 12607, 3447, 15, 2533, 6948, 35699, 1155, 11, 11864, 7076, 6382, 18552, 27301, 353, 52433, 81362, 8, 1465, 341, 197, 853, 12554, 25449, 27301, 11, 2915, 17483, 353, 2068, 28258, 8, 1465, 341, 298, 743, 5430, 94025, 27301, 11, 3383, 9910, 8, 341, 571, 197, 39021, 284, 8737, 7, 39021, 11, 3383, 340, 298, 197, 532, 298, 853, 2092, 198, 197, 197, 3518, 197, 44194, 6948, 12808, 1155, 11, 2422, 7, 39021, 701, 220, 15, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMapProxy_ExecuteOnEntriesWithPredicate(t *testing.T) { config := hazelcast.NewHazelcastConfig() expectedValue := "newValue" processor := newSimpleEntryProcessor(expectedValue) config.SerializationConfig().AddDataSerializableFactory(processor.identifiedFactory.factoryId, processor.identifiedFactory) client, _ := hazelcast.NewHazelcastClientWithConfig(config) mp2, _ := client.GetMap("testMap2") for i := 0; i < 10; i++ { testKey := "testingKey" + strconv.Itoa(i) testValue := int32(i) mp2.Put(testKey, testValue) } result, err := mp2.ExecuteOnEntriesWithPredicate(processor, GreaterThan("this", int32(6))) if len(result) != 3 { t.Fatal("ExecuteOnEntriesWithPredicate failed") } for _, pair := range result { AssertEqualf(t, err, pair.Value(), expectedValue, "ExecuteOnEntriesWithPredicate failed") newValue, err := mp2.Get(pair.Key()) AssertEqualf(t, err, newValue, expectedValue, "ExecuteOnEntriesWithPredicate failed") } mp.Clear() client.Shutdown() }
explode_data.jsonl/57040
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 348 }
[ 2830, 3393, 2227, 16219, 83453, 1925, 24533, 2354, 36329, 1155, 353, 8840, 836, 8, 341, 25873, 1669, 20144, 301, 3829, 7121, 39, 68326, 3829, 2648, 741, 42400, 1130, 1669, 330, 52830, 698, 197, 29474, 1669, 501, 16374, 5874, 22946, 15253, 1130, 340, 25873, 27255, 2648, 1005, 2212, 1043, 29268, 4153, 21929, 269, 13, 42260, 4153, 14081, 764, 11, 17654, 13, 42260, 4153, 340, 25291, 11, 716, 1669, 20144, 301, 3829, 7121, 39, 68326, 3829, 2959, 2354, 2648, 8754, 340, 53230, 17, 11, 716, 1669, 2943, 2234, 2227, 445, 1944, 2227, 17, 1138, 2023, 600, 1669, 220, 15, 26, 600, 366, 220, 16, 15, 26, 600, 1027, 341, 197, 18185, 1592, 1669, 330, 8840, 1592, 1, 488, 33317, 64109, 1956, 340, 197, 18185, 1130, 1669, 526, 18, 17, 1956, 340, 197, 53230, 17, 39825, 8623, 1592, 11, 1273, 1130, 340, 197, 532, 9559, 11, 1848, 1669, 10490, 17, 13827, 1925, 24533, 2354, 36329, 21929, 269, 11, 32281, 26067, 445, 574, 497, 526, 18, 17, 7, 21, 5929, 743, 2422, 4456, 8, 961, 220, 18, 341, 197, 3244, 26133, 445, 17174, 1925, 24533, 2354, 36329, 4641, 1138, 197, 532, 2023, 8358, 6716, 1669, 2088, 1102, 341, 197, 18017, 2993, 69, 1155, 11, 1848, 11, 6716, 6167, 1507, 3601, 1130, 11, 330, 17174, 1925, 24533, 2354, 36329, 4641, 1138, 197, 8638, 1130, 11, 1848, 1669, 10490, 17, 2234, 39144, 9610, 2398, 197, 18017, 2993, 69, 1155, 11, 1848, 11, 24174, 11, 3601, 1130, 11, 330, 17174, 1925, 24533, 2354, 36329, 4641, 1138, 197, 532, 53230, 13524, 741, 25291, 10849, 18452, 741, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCreateBucketIfNotExist(t *testing.T) { err = testdb.CreateBucketIfNotExist("test") if err != nil { t.Fatalf("Could not create bucket. %v", err) } // Should not fail if we create bucket again err = testdb.CreateBucketIfNotExist("test") if err != nil { t.Fatalf("Could not create bucket. %v", err) } }
explode_data.jsonl/51082
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 120 }
[ 2830, 3393, 4021, 36018, 2679, 45535, 1155, 353, 8840, 836, 8, 341, 9859, 284, 1273, 1999, 7251, 36018, 2679, 45535, 445, 1944, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 12895, 537, 1855, 15621, 13, 1018, 85, 497, 1848, 340, 197, 532, 197, 322, 12260, 537, 3690, 421, 582, 1855, 15621, 1549, 198, 9859, 284, 1273, 1999, 7251, 36018, 2679, 45535, 445, 1944, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 12895, 537, 1855, 15621, 13, 1018, 85, 497, 1848, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTopDownTime(t *testing.T) { ast.RegisterBuiltin(&ast.Builtin{ Name: "test_sleep", Decl: types.NewFunction( types.Args(types.S), nil, ), }) RegisterFunctionalBuiltinVoid1("test_sleep", func(a ast.Value) error { duration, err := time.ParseDuration(string(a.(ast.String))) if err != nil { panic(err) } time.Sleep(duration) return nil }) data := loadSmallTestData() runTopDownTestCase(t, data, "time caching", []string{` p { time.now_ns(t0); test_sleep("10ms"); time.now_ns(t1); t1 = t2 } `}, "true") runTopDownTestCase(t, data, "parse nanos", []string{` p = ns { time.parse_ns("2006-01-02T15:04:05Z07:00", "2017-06-02T19:00:00-07:00", ns) } `}, "1496455200000000000") runTopDownTestCase(t, data, "parse rfc3339 nanos", []string{` p = ns { time.parse_rfc3339_ns("2017-06-02T19:00:00-07:00", ns) } `}, "1496455200000000000") runTopDownTestCase(t, data, "parse duration nanos", []string{` p = ns { time.parse_duration_ns("100ms", ns) } `}, "100000000") }
explode_data.jsonl/25217
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 435 }
[ 2830, 3393, 5366, 4454, 1462, 1155, 353, 8840, 836, 8, 1476, 88836, 19983, 33, 25628, 2099, 559, 1785, 25628, 515, 197, 21297, 25, 330, 1944, 49393, 756, 197, 197, 21629, 25, 4494, 7121, 5152, 1006, 298, 98785, 51015, 52613, 808, 1326, 298, 84131, 345, 197, 197, 1326, 197, 8824, 79096, 71271, 33, 25628, 35882, 16, 445, 1944, 49393, 497, 2915, 2877, 11763, 6167, 8, 1465, 341, 197, 89300, 11, 1848, 1669, 882, 8937, 12945, 3609, 2877, 12832, 559, 6431, 5929, 197, 743, 1848, 961, 2092, 341, 298, 30764, 3964, 340, 197, 197, 532, 197, 21957, 31586, 48148, 340, 197, 853, 2092, 198, 197, 8824, 8924, 1669, 2795, 25307, 83920, 2822, 56742, 5366, 4454, 16458, 1155, 11, 821, 11, 330, 1678, 47430, 497, 3056, 917, 90, 3989, 197, 3223, 314, 882, 10700, 34728, 1155, 15, 1215, 1273, 49393, 445, 16, 15, 1011, 5038, 882, 10700, 34728, 1155, 16, 1215, 259, 16, 284, 259, 17, 456, 197, 63, 2137, 330, 1866, 5130, 56742, 5366, 4454, 16458, 1155, 11, 821, 11, 330, 6400, 20021, 436, 497, 3056, 917, 90, 3989, 197, 3223, 284, 12268, 314, 882, 4632, 34728, 445, 17, 15, 15, 21, 12, 15, 16, 12, 15, 17, 51, 16, 20, 25, 15, 19, 25, 15, 20, 57, 15, 22, 25, 15, 15, 497, 330, 17, 15, 16, 22, 12, 15, 21, 12, 15, 17, 51, 16, 24, 25, 15, 15, 25, 15, 15, 12, 15, 22, 25, 15, 15, 497, 12268, 8, 456, 197, 63, 2137, 330, 16, 19, 24, 21, 19, 20, 20, 17, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5130, 56742, 5366, 4454, 16458, 1155, 11, 821, 11, 330, 6400, 435, 8316, 18, 18, 18, 24, 20021, 436, 497, 3056, 917, 90, 3989, 197, 3223, 284, 12268, 314, 882, 4632, 1710, 8316, 18, 18, 18, 24, 34728, 445, 17, 15, 16, 22, 12, 15, 21, 12, 15, 17, 51, 16, 24, 25, 15, 15, 25, 15, 15, 12, 15, 22, 25, 15, 15, 497, 12268, 8, 456, 197, 197, 63, 2137, 330, 16, 19, 24, 21, 19, 20, 20, 17, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5130, 56742, 5366, 4454, 16458, 1155, 11, 821, 11, 330, 6400, 8090, 20021, 436, 497, 3056, 917, 90, 3989, 197, 3223, 284, 12268, 314, 882, 4632, 25454, 34728, 445, 16, 15, 15, 1011, 497, 12268, 8, 456, 197, 63, 2137, 330, 16, 15, 15, 15, 15, 15, 15, 15, 15, 1138, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestJobRunsController_Create_ExternalInitiator_Success(t *testing.T) { t.Parallel() ethClient, _, assertMocksCalled := cltest.NewEthMocksWithStartupAssertions(t) defer assertMocksCalled() app, cleanup := cltest.NewApplication(t, ethClient, ) defer cleanup() app.Start() url := cltest.WebURL(t, "http://localhost:8888") eia := auth.NewToken() eir := &models.ExternalInitiatorRequest{ Name: "bitcoin", URL: &url, } ei, err := models.NewExternalInitiator(eia, eir) require.NoError(t, err) assert.NoError(t, app.Store.CreateExternalInitiator(ei)) j := cltest.NewJobWithExternalInitiator(ei) assert.NoError(t, app.Store.CreateJob(&j)) jr := cltest.CreateJobRunViaExternalInitiator( t, app, j, *eia, `{"result":"100"}`, ) jr = cltest.WaitForJobRunToComplete(t, app.Store, jr) value := cltest.MustResultString(t, jr.Result) assert.Equal(t, "100", value) }
explode_data.jsonl/49844
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 356 }
[ 2830, 3393, 12245, 73920, 2051, 34325, 62, 25913, 3803, 36122, 87161, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 197, 769, 2959, 11, 8358, 2060, 72577, 20960, 1669, 1185, 1944, 7121, 65390, 11571, 16056, 39076, 90206, 1155, 340, 16867, 2060, 72577, 20960, 741, 28236, 11, 21290, 1669, 1185, 1944, 7121, 4988, 1155, 345, 197, 197, 769, 2959, 345, 197, 340, 16867, 21290, 741, 28236, 12101, 2822, 19320, 1669, 1185, 1944, 6473, 3144, 1155, 11, 330, 1254, 1110, 8301, 25, 23, 23, 23, 23, 1138, 7727, 685, 1669, 4166, 7121, 3323, 741, 7727, 404, 1669, 609, 6507, 5121, 15342, 3803, 36122, 1900, 515, 197, 21297, 25, 330, 83910, 756, 197, 79055, 25, 220, 609, 1085, 345, 197, 532, 7727, 72, 11, 1848, 1669, 4119, 7121, 25913, 3803, 36122, 2026, 685, 11, 384, 404, 340, 17957, 35699, 1155, 11, 1848, 340, 6948, 35699, 1155, 11, 906, 38047, 7251, 25913, 3803, 36122, 2026, 72, 4390, 12428, 1669, 1185, 1944, 7121, 12245, 2354, 25913, 3803, 36122, 2026, 72, 340, 6948, 35699, 1155, 11, 906, 38047, 7251, 12245, 2099, 73, 4390, 12428, 81, 1669, 1185, 1944, 7251, 12245, 6727, 54428, 25913, 3803, 36122, 1006, 197, 3244, 11, 906, 345, 197, 12428, 11, 353, 68, 685, 11, 1565, 4913, 1382, 3252, 16, 15, 15, 1, 27249, 197, 340, 12428, 81, 284, 1185, 1944, 99153, 12245, 6727, 1249, 12548, 1155, 11, 906, 38047, 11, 79598, 340, 16309, 1669, 1185, 1944, 50463, 2077, 703, 1155, 11, 79598, 18456, 340, 6948, 12808, 1155, 11, 330, 16, 15, 15, 497, 897, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestBiWeekly(t *testing.T) { doTestNWeekly(t, "[] bla (every 2nd thursday)", moment.RecurBiWeekly, 2, tu.DtUtc("18.10.2019"), tu.DtUtc("17.10.2019")) }
explode_data.jsonl/67519
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 72 }
[ 2830, 3393, 36096, 80516, 1155, 353, 8840, 836, 8, 341, 19935, 2271, 45, 80516, 1155, 11, 330, 1294, 84541, 320, 29015, 220, 17, 303, 270, 7181, 11583, 4445, 2817, 2352, 36096, 80516, 11, 220, 17, 11, 9765, 909, 83, 97768, 445, 16, 23, 13, 16, 15, 13, 17, 15, 16, 24, 3975, 9765, 909, 83, 97768, 445, 16, 22, 13, 16, 15, 13, 17, 15, 16, 24, 5455, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestController_GetUsers_200(t *testing.T) { // prepare request req := httptest.NewRequest(http.MethodGet, "/", nil) rec := httptest.NewRecorder() // prepare echo context e := echo.New() ctx := e.NewContext(req, rec) // prepare controller c := NewController() err := c.GetUsers(ctx, "aaa") if assert.NoError(t, err) { assert.Equal(t, http.StatusOK, rec.Code) assert.NotEmpty(t, rec.Body.String()) } }
explode_data.jsonl/46228
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 159 }
[ 2830, 3393, 2051, 13614, 7137, 62, 17, 15, 15, 1155, 353, 8840, 836, 8, 341, 197, 322, 10549, 1681, 198, 24395, 1669, 54320, 70334, 75274, 19886, 20798, 1949, 11, 64657, 2092, 340, 67904, 1669, 54320, 70334, 7121, 47023, 741, 197, 322, 10549, 1687, 2266, 198, 7727, 1669, 1687, 7121, 741, 20985, 1669, 384, 7121, 1972, 6881, 11, 1395, 340, 197, 322, 10549, 6461, 198, 1444, 1669, 1532, 2051, 2822, 9859, 1669, 272, 2234, 7137, 7502, 11, 330, 32646, 5130, 743, 2060, 35699, 1155, 11, 1848, 8, 341, 197, 6948, 12808, 1155, 11, 1758, 52989, 11, 1395, 20274, 340, 197, 6948, 15000, 3522, 1155, 11, 1395, 20934, 6431, 2398, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestInsecureAlgorithmErrorString(t *testing.T) { tests := []struct { sa SignatureAlgorithm want string }{ {MD2WithRSA, "x509: cannot verify signature: insecure algorithm MD2-RSA"}, {-1, "x509: cannot verify signature: insecure algorithm -1"}, {0, "x509: cannot verify signature: insecure algorithm 0"}, {9999, "x509: cannot verify signature: insecure algorithm 9999"}, } for i, tt := range tests { if got := fmt.Sprint(InsecureAlgorithmError(tt.sa)); got != tt.want { t.Errorf("%d. mismatch.\n got: %s\nwant: %s\n", i, got, tt.want) } } }
explode_data.jsonl/68009
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 212 }
[ 2830, 3393, 641, 25132, 27847, 1454, 703, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 1903, 64, 256, 32232, 27847, 198, 197, 50780, 914, 198, 197, 59403, 197, 197, 90, 6076, 17, 2354, 73564, 11, 330, 87, 20, 15, 24, 25, 4157, 10146, 11957, 25, 61845, 12111, 13979, 17, 10911, 7778, 7115, 197, 197, 19999, 16, 11, 330, 87, 20, 15, 24, 25, 4157, 10146, 11957, 25, 61845, 12111, 481, 16, 7115, 197, 197, 90, 15, 11, 330, 87, 20, 15, 24, 25, 4157, 10146, 11957, 25, 61845, 12111, 220, 15, 7115, 197, 197, 90, 24, 24, 24, 24, 11, 330, 87, 20, 15, 24, 25, 4157, 10146, 11957, 25, 61845, 12111, 220, 24, 24, 24, 24, 7115, 197, 532, 2023, 600, 11, 17853, 1669, 2088, 7032, 341, 197, 743, 2684, 1669, 8879, 808, 1350, 47614, 25132, 27847, 1454, 47152, 53662, 5905, 2684, 961, 17853, 70212, 341, 298, 3244, 13080, 4430, 67, 13, 35301, 7110, 77, 2684, 25, 1018, 82, 1699, 52657, 25, 1018, 82, 1699, 497, 600, 11, 2684, 11, 17853, 70212, 340, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGETPlayers(t *testing.T) { store := StubPlayerStore{ map[string]int{ "Pepper": 20, "Floyd": 10, }, nil, nil, } server := NewPlayerServer(&store) t.Run("returns Pepper's score", func(t *testing.T) { request := newGetScoreRequest("Pepper") response := httptest.NewRecorder() server.ServeHTTP(response, request) assertStatus(t, response.Code, http.StatusOK) assertResponseBody(t, response.Body.String(), "20") }) t.Run("returns Floyd's score", func(t *testing.T) { request := newGetScoreRequest("Floyd") response := httptest.NewRecorder() server.ServeHTTP(response, request) assertStatus(t, response.Code, http.StatusOK) assertResponseBody(t, response.Body.String(), "10") }) t.Run("returns 404 on missing players", func(t *testing.T) { request := newGetScoreRequest("Apollo") response := httptest.NewRecorder() server.ServeHTTP(response, request) assertStatus(t, response.Code, http.StatusNotFound) }) }
explode_data.jsonl/29293
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 357 }
[ 2830, 3393, 3806, 24257, 1155, 353, 8840, 836, 8, 341, 57279, 1669, 66611, 4476, 6093, 515, 197, 19567, 14032, 63025, 515, 298, 197, 1, 10197, 6922, 788, 220, 17, 15, 345, 298, 197, 86555, 25796, 788, 220, 220, 16, 15, 345, 197, 197, 1583, 197, 84131, 345, 197, 84131, 345, 197, 532, 41057, 1669, 1532, 4476, 5475, 2099, 4314, 692, 3244, 16708, 445, 4216, 51782, 594, 5456, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 23555, 1669, 501, 1949, 10570, 1900, 445, 10197, 6922, 1138, 197, 21735, 1669, 54320, 70334, 7121, 47023, 2822, 197, 41057, 83535, 9230, 5684, 11, 1681, 692, 197, 6948, 2522, 1155, 11, 2033, 20274, 11, 1758, 52989, 340, 197, 6948, 29637, 1155, 11, 2033, 20934, 6431, 1507, 330, 17, 15, 1138, 197, 8824, 3244, 16708, 445, 4216, 45799, 594, 5456, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 23555, 1669, 501, 1949, 10570, 1900, 445, 37, 25796, 1138, 197, 21735, 1669, 54320, 70334, 7121, 47023, 2822, 197, 41057, 83535, 9230, 5684, 11, 1681, 692, 197, 6948, 2522, 1155, 11, 2033, 20274, 11, 1758, 52989, 340, 197, 6948, 29637, 1155, 11, 2033, 20934, 6431, 1507, 330, 16, 15, 1138, 197, 8824, 3244, 16708, 445, 4216, 220, 19, 15, 19, 389, 7402, 4217, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 23555, 1669, 501, 1949, 10570, 1900, 445, 95909, 1138, 197, 21735, 1669, 54320, 70334, 7121, 47023, 2822, 197, 41057, 83535, 9230, 5684, 11, 1681, 692, 197, 6948, 2522, 1155, 11, 2033, 20274, 11, 1758, 10538, 10372, 340, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNewMapwatcherToEventMap(t *testing.T) { k0, k1, k2 := []byte("foo0"), []byte("foo1"), []byte("foo2") v0, v1, v2 := []byte("bar0"), []byte("bar1"), []byte("bar2") ws := []*watcher{{key: k0}, {key: k1}, {key: k2}} evs := []mvccpb.Event{ { Type: mvccpb.PUT, Kv: &mvccpb.KeyValue{Key: k0, Value: v0}, }, { Type: mvccpb.PUT, Kv: &mvccpb.KeyValue{Key: k1, Value: v1}, }, { Type: mvccpb.PUT, Kv: &mvccpb.KeyValue{Key: k2, Value: v2}, }, } tests := []struct { sync []*watcher evs []mvccpb.Event wwe map[*watcher][]mvccpb.Event }{ // no watcher in sync, some events should return empty wwe { nil, evs, map[*watcher][]mvccpb.Event{}, }, // one watcher in sync, one event that does not match the key of that // watcher should return empty wwe { []*watcher{ws[2]}, evs[:1], map[*watcher][]mvccpb.Event{}, }, // one watcher in sync, one event that matches the key of that // watcher should return wwe with that matching watcher { []*watcher{ws[1]}, evs[1:2], map[*watcher][]mvccpb.Event{ ws[1]: evs[1:2], }, }, // two watchers in sync that watches two different keys, one event // that matches the key of only one of the watcher should return wwe // with the matching watcher { []*watcher{ws[0], ws[2]}, evs[2:], map[*watcher][]mvccpb.Event{ ws[2]: evs[2:], }, }, // two watchers in sync that watches the same key, two events that // match the keys should return wwe with those two watchers { []*watcher{ws[0], ws[1]}, evs[:2], map[*watcher][]mvccpb.Event{ ws[0]: evs[:1], ws[1]: evs[1:2], }, }, } for i, tt := range tests { wg := newWatcherGroup() for _, w := range tt.sync { wg.add(w) } gwe := newWatcherBatch(&wg, tt.evs) if len(gwe) != len(tt.wwe) { t.Errorf("#%d: len(gwe) got = %d, want = %d", i, len(gwe), len(tt.wwe)) } // compare gwe and tt.wwe for w, eb := range gwe { if len(eb.evs) != len(tt.wwe[w]) { t.Errorf("#%d: len(eb.evs) got = %d, want = %d", i, len(eb.evs), len(tt.wwe[w])) } if !reflect.DeepEqual(eb.evs, tt.wwe[w]) { t.Errorf("#%d: reflect.DeepEqual events got = %v, want = true", i, false) } } } }
explode_data.jsonl/67210
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1117 }
[ 2830, 3393, 3564, 2227, 14321, 261, 1249, 1556, 2227, 1155, 353, 8840, 836, 8, 341, 16463, 15, 11, 595, 16, 11, 595, 17, 1669, 3056, 3782, 445, 7975, 15, 3975, 3056, 3782, 445, 7975, 16, 3975, 3056, 3782, 445, 7975, 17, 1138, 5195, 15, 11, 348, 16, 11, 348, 17, 1669, 3056, 3782, 445, 2257, 15, 3975, 3056, 3782, 445, 2257, 16, 3975, 3056, 3782, 445, 2257, 17, 5130, 6692, 82, 1669, 29838, 14321, 261, 2979, 792, 25, 595, 15, 2137, 314, 792, 25, 595, 16, 2137, 314, 792, 25, 595, 17, 47449, 74837, 82, 1669, 3056, 26002, 638, 16650, 6904, 515, 197, 197, 515, 298, 27725, 25, 23164, 638, 16650, 98371, 345, 298, 39340, 85, 25, 256, 609, 26002, 638, 16650, 9610, 1130, 90, 1592, 25, 595, 15, 11, 5162, 25, 348, 15, 1583, 197, 197, 1583, 197, 197, 515, 298, 27725, 25, 23164, 638, 16650, 98371, 345, 298, 39340, 85, 25, 256, 609, 26002, 638, 16650, 9610, 1130, 90, 1592, 25, 595, 16, 11, 5162, 25, 348, 16, 1583, 197, 197, 1583, 197, 197, 515, 298, 27725, 25, 23164, 638, 16650, 98371, 345, 298, 39340, 85, 25, 256, 609, 26002, 638, 16650, 9610, 1130, 90, 1592, 25, 595, 17, 11, 5162, 25, 348, 17, 1583, 197, 197, 1583, 197, 630, 78216, 1669, 3056, 1235, 341, 197, 1903, 1721, 29838, 14321, 261, 198, 197, 74837, 82, 220, 3056, 26002, 638, 16650, 6904, 271, 197, 6692, 896, 2415, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 198, 197, 59403, 197, 197, 322, 902, 55727, 304, 12811, 11, 1045, 4357, 1265, 470, 4287, 289, 896, 198, 197, 197, 515, 298, 84131, 345, 298, 74837, 82, 345, 298, 19567, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 38837, 197, 197, 15766, 197, 197, 322, 825, 55727, 304, 12811, 11, 825, 1538, 429, 1558, 537, 2432, 279, 1376, 315, 429, 198, 197, 197, 322, 55727, 1265, 470, 4287, 289, 896, 198, 197, 197, 515, 298, 197, 1294, 9, 14321, 261, 90, 8915, 58, 17, 57352, 298, 74837, 82, 3447, 16, 1259, 298, 19567, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 38837, 197, 197, 15766, 197, 197, 322, 825, 55727, 304, 12811, 11, 825, 1538, 429, 9071, 279, 1376, 315, 429, 198, 197, 197, 322, 55727, 1265, 470, 289, 896, 448, 429, 12579, 55727, 198, 197, 197, 515, 298, 197, 1294, 9, 14321, 261, 90, 8915, 58, 16, 57352, 298, 74837, 82, 58, 16, 25, 17, 1259, 298, 19567, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 515, 571, 6692, 82, 58, 16, 5669, 3637, 82, 58, 16, 25, 17, 1259, 298, 197, 1583, 197, 197, 15766, 197, 197, 322, 1378, 86572, 304, 12811, 429, 31760, 1378, 2155, 6894, 11, 825, 1538, 198, 197, 197, 322, 429, 9071, 279, 1376, 315, 1172, 825, 315, 279, 55727, 1265, 470, 289, 896, 198, 197, 197, 322, 448, 279, 12579, 55727, 198, 197, 197, 515, 298, 197, 1294, 9, 14321, 261, 90, 8915, 58, 15, 1125, 17624, 58, 17, 57352, 298, 74837, 82, 58, 17, 25, 1259, 298, 19567, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 515, 571, 6692, 82, 58, 17, 5669, 3637, 82, 58, 17, 25, 1259, 298, 197, 1583, 197, 197, 15766, 197, 197, 322, 1378, 86572, 304, 12811, 429, 31760, 279, 1852, 1376, 11, 1378, 4357, 429, 198, 197, 197, 322, 2432, 279, 6894, 1265, 470, 289, 896, 448, 1846, 1378, 86572, 198, 197, 197, 515, 298, 197, 1294, 9, 14321, 261, 90, 8915, 58, 15, 1125, 17624, 58, 16, 57352, 298, 74837, 82, 3447, 17, 1259, 298, 19567, 33836, 14321, 261, 45725, 26002, 638, 16650, 6904, 515, 571, 6692, 82, 58, 15, 5669, 3637, 82, 3447, 16, 1259, 571, 6692, 82, 58, 16, 5669, 3637, 82, 58, 16, 25, 17, 1259, 298, 197, 1583, 197, 197, 1583, 197, 630, 2023, 600, 11, 17853, 1669, 2088, 7032, 341, 197, 72079, 1669, 501, 47248, 2808, 741, 197, 2023, 8358, 289, 1669, 2088, 17853, 30712, 341, 298, 72079, 1364, 3622, 340, 197, 197, 630, 197, 3174, 896, 1669, 501, 47248, 21074, 2099, 45540, 11, 17853, 1734, 11562, 340, 197, 743, 2422, 3268, 896, 8, 961, 2422, 47152, 1418, 896, 8, 341, 298, 3244, 13080, 3584, 4, 67, 25, 2422, 3268, 896, 8, 2684, 284, 1018, 67, 11, 1366, 284, 1018, 67, 497, 600, 11, 2422, 3268, 896, 701, 2422, 47152, 1418, 896, 1171, 197, 197, 532, 197, 197, 322, 9429, 342, 896, 323, 17853, 1418, 896, 198, 197, 2023, 289, 11, 24463, 1669, 2088, 342, 896, 341, 298, 743, 2422, 2026, 65, 1734, 11562, 8, 961, 2422, 47152, 1418, 896, 39184, 2467, 341, 571, 3244, 13080, 3584, 4, 67, 25, 2422, 2026, 65, 1734, 11562, 8, 2684, 284, 1018, 67, 11, 1366, 284, 1018, 67, 497, 600, 11, 2422, 2026, 65, 1734, 11562, 701, 2422, 47152, 1418, 896, 39184, 10907, 298, 197, 532, 298, 743, 753, 34913, 94750, 2026, 65, 1734, 11562, 11, 17853, 1418, 896, 39184, 2467, 341, 571, 3244, 13080, 3584, 4, 67, 25, 8708, 94750, 4357, 2684, 284, 1018, 85, 11, 1366, 284, 830, 497, 600, 11, 895, 340, 298, 197, 532, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
7
func TestWalletSignTransaction(t *testing.T) { wallet, err := initializeWallet() assert.Nil(t, err) // Build a mock transaction gas := uint64(1000000) gasPrice := int64(1000000000) tx := types.NewTransaction( 0, common.HexToAddress("0x6f6704e5a10332af6672e50b3d9754dc460dfa4d"), big.NewInt(0), gas, big.NewInt(gasPrice), []byte("data"), ) tx, err = wallet.SignTransaction(tx) assert.Nil(t, err) V, R, S := tx.RawSignatureValues() assert.NotEqual(t, new(big.Int), V) assert.NotEqual(t, new(big.Int), R) assert.NotEqual(t, new(big.Int), S) }
explode_data.jsonl/25346
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 246 }
[ 2830, 3393, 38259, 7264, 8070, 1155, 353, 8840, 836, 8, 341, 6692, 7464, 11, 1848, 1669, 9468, 38259, 741, 6948, 59678, 1155, 11, 1848, 692, 197, 322, 7854, 264, 7860, 7745, 198, 3174, 300, 1669, 2622, 21, 19, 7, 16, 15, 15, 15, 15, 15, 15, 340, 3174, 300, 6972, 1669, 526, 21, 19, 7, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 340, 46237, 1669, 4494, 7121, 8070, 1006, 197, 197, 15, 345, 197, 83825, 91538, 1249, 4286, 445, 15, 87, 21, 69, 21, 22, 15, 19, 68, 20, 64, 16, 15, 18, 18, 17, 2577, 21, 21, 22, 17, 68, 20, 15, 65, 18, 67, 24, 22, 20, 19, 7628, 19, 21, 15, 97549, 19, 67, 4461, 197, 2233, 343, 7121, 1072, 7, 15, 1326, 197, 3174, 300, 345, 197, 2233, 343, 7121, 1072, 3268, 300, 6972, 1326, 197, 197, 1294, 3782, 445, 691, 4461, 197, 692, 46237, 11, 1848, 284, 15085, 41152, 8070, 27301, 340, 6948, 59678, 1155, 11, 1848, 692, 17446, 11, 431, 11, 328, 1669, 9854, 50575, 25088, 6227, 741, 6948, 15000, 2993, 1155, 11, 501, 75616, 7371, 701, 647, 340, 6948, 15000, 2993, 1155, 11, 501, 75616, 7371, 701, 431, 340, 6948, 15000, 2993, 1155, 11, 501, 75616, 7371, 701, 328, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestHasPrefix(t *testing.T) { cases := []struct { s interface{} prefix interface{} want interface{} isErr bool }{ {"abcd", "ab", true, false}, {"abcd", "cd", false, false}, {template.HTML("abcd"), "ab", true, false}, {template.HTML("abcd"), "cd", false, false}, {template.HTML("1234"), 12, true, false}, {template.HTML("1234"), 34, false, false}, {[]byte("abcd"), "ab", true, false}, } for i, c := range cases { res, err := hasPrefix(c.s, c.prefix) if (err != nil) != c.isErr { t.Fatalf("[%d] unexpected isErr state: want %v, got %v, err = %v", i, c.isErr, err != nil, err) } if res != c.want { t.Errorf("[%d] want %v, got %v", i, c.want, res) } } }
explode_data.jsonl/9220
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 320 }
[ 2830, 3393, 10281, 14335, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 1903, 414, 3749, 16094, 197, 3223, 5060, 3749, 16094, 197, 50780, 256, 3749, 16094, 197, 19907, 7747, 220, 1807, 198, 197, 59403, 197, 197, 4913, 68644, 497, 330, 370, 497, 830, 11, 895, 1583, 197, 197, 4913, 68644, 497, 330, 4385, 497, 895, 11, 895, 1583, 197, 197, 90, 4214, 65753, 445, 68644, 3975, 330, 370, 497, 830, 11, 895, 1583, 197, 197, 90, 4214, 65753, 445, 68644, 3975, 330, 4385, 497, 895, 11, 895, 1583, 197, 197, 90, 4214, 65753, 445, 16, 17, 18, 19, 3975, 220, 16, 17, 11, 830, 11, 895, 1583, 197, 197, 90, 4214, 65753, 445, 16, 17, 18, 19, 3975, 220, 18, 19, 11, 895, 11, 895, 1583, 197, 197, 90, 1294, 3782, 445, 68644, 3975, 330, 370, 497, 830, 11, 895, 1583, 197, 630, 2023, 600, 11, 272, 1669, 2088, 5048, 341, 197, 10202, 11, 1848, 1669, 702, 14335, 1337, 514, 11, 272, 38543, 340, 197, 743, 320, 615, 961, 2092, 8, 961, 272, 2079, 7747, 341, 298, 3244, 30762, 57252, 67, 60, 16500, 374, 7747, 1584, 25, 1366, 1018, 85, 11, 2684, 1018, 85, 11, 1848, 284, 1018, 85, 497, 600, 11, 272, 2079, 7747, 11, 1848, 961, 2092, 11, 1848, 340, 197, 197, 532, 197, 743, 592, 961, 272, 70212, 341, 298, 3244, 13080, 57252, 67, 60, 1366, 1018, 85, 11, 2684, 1018, 85, 497, 600, 11, 272, 70212, 11, 592, 340, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestValidateComponentConfig(t *testing.T) { testCases := []struct { name string config *Config errExpected bool }{ { name: "Valid default URL, no err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{"*": "https://my-prow"}}}}, errExpected: false, }, { name: "Invalid default URL, err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{"*": "https:// my-prow"}}}}, errExpected: true, }, { name: "Org config, valid URLs, no err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https://my-prow", "my-org": "https://my-alternate-prow", }, }}}, errExpected: false, }, { name: "Org override, invalid default jobURLPrefix URL, err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https:// my-prow", "my-org": "https://my-alternate-prow", }, }}}, errExpected: true, }, { name: "Org override, invalid org URL, err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https://my-prow", "my-org": "https:// my-alternate-prow", }, }}}, errExpected: true, }, { name: "Org override, invalid URLs, err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https:// my-prow", "my-org": "https:// my-alternate-prow", }, }}}, errExpected: true, }, { name: "Repo override, valid URLs, no err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https://my-prow", "my-org": "https://my-alternate-prow", "my-org/my-repo": "https://my-third-prow", }}}}, errExpected: false, }, { name: "Repo override, invalid repo URL, err", config: &Config{ProwConfig: ProwConfig{Plank: Plank{ JobURLPrefixConfig: map[string]string{ "*": "https://my-prow", "my-org": "https://my-alternate-prow", "my-org/my-repo": "https:// my-third-prow", }}}}, errExpected: true, }, { name: "Both RerunAuthConfig and RerunAuthConfigs are invalid, err", config: &Config{ProwConfig: ProwConfig{Deck: Deck{ RerunAuthConfig: &prowapi.RerunAuthConfig{AllowAnyone: true}, RerunAuthConfigs: RerunAuthConfigs{"*": prowapi.RerunAuthConfig{AllowAnyone: true}}, }}}, errExpected: true, }, { name: "RerunAuthConfig and not RerunAuthConfigs is valid, no err", config: &Config{ProwConfig: ProwConfig{Deck: Deck{ RerunAuthConfig: &prowapi.RerunAuthConfig{AllowAnyone: false, GitHubUsers: []string{"grantsmith"}}, }}}, errExpected: false, }, { name: "RerunAuthConfig only and validation fails, err", config: &Config{ProwConfig: ProwConfig{Deck: Deck{ RerunAuthConfig: &prowapi.RerunAuthConfig{AllowAnyone: true, GitHubUsers: []string{"grantsmith"}}, }}}, errExpected: true, }, { name: "RerunAuthConfigs and not RerunAuthConfig is valid, no err", config: &Config{ProwConfig: ProwConfig{Deck: Deck{ RerunAuthConfigs: RerunAuthConfigs{ "*": prowapi.RerunAuthConfig{AllowAnyone: true}, "kubernetes": prowapi.RerunAuthConfig{GitHubUsers: []string{"easterbunny"}}, "kubernetes/kubernetes": prowapi.RerunAuthConfig{GitHubOrgs: []string{"kubernetes", "kubernetes-sigs"}}, }, }}}, errExpected: false, }, { name: "RerunAuthConfigs only and validation fails, err", config: &Config{ProwConfig: ProwConfig{Deck: Deck{ RerunAuthConfigs: RerunAuthConfigs{ "*": prowapi.RerunAuthConfig{AllowAnyone: true}, "kubernetes": prowapi.RerunAuthConfig{GitHubUsers: []string{"easterbunny"}}, "kubernetes/kubernetes": prowapi.RerunAuthConfig{AllowAnyone: true, GitHubOrgs: []string{"kubernetes", "kubernetes-sigs"}}, }, }}}, errExpected: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { if hasErr := tc.config.validateComponentConfig() != nil; hasErr != tc.errExpected { t.Errorf("expected err: %t but was %t", tc.errExpected, hasErr) } }) } }
explode_data.jsonl/8087
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 2018 }
[ 2830, 3393, 17926, 2189, 2648, 1155, 353, 8840, 836, 8, 341, 18185, 37302, 1669, 3056, 1235, 341, 197, 11609, 286, 914, 198, 197, 25873, 414, 353, 2648, 198, 197, 9859, 18896, 1807, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 330, 4088, 1638, 5548, 11, 902, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 4913, 9, 788, 330, 2428, 1110, 2408, 2268, 651, 30975, 22050, 298, 9859, 18896, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 7928, 1638, 5548, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 4913, 9, 788, 330, 2428, 1110, 847, 2268, 651, 30975, 22050, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 42437, 2193, 11, 2697, 35006, 11, 902, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 414, 330, 2428, 1110, 2408, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 330, 2428, 1110, 2408, 18779, 4160, 349, 2268, 651, 756, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 42437, 2812, 11, 8318, 1638, 2618, 3144, 14335, 5548, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 414, 330, 2428, 1110, 847, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 330, 2428, 1110, 2408, 18779, 4160, 349, 2268, 651, 756, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 42437, 2812, 11, 8318, 1240, 5548, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 414, 330, 2428, 1110, 2408, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 330, 2428, 1110, 847, 18779, 4160, 349, 2268, 651, 756, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 42437, 2812, 11, 8318, 35006, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 414, 330, 2428, 1110, 847, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 330, 2428, 1110, 847, 18779, 4160, 349, 2268, 651, 756, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 25243, 2812, 11, 2697, 35006, 11, 902, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 1060, 330, 2428, 1110, 2408, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 260, 330, 2428, 1110, 2408, 18779, 4160, 349, 2268, 651, 756, 464, 197, 1, 2408, 71184, 34198, 5504, 5368, 788, 330, 2428, 1110, 2408, 29177, 2268, 651, 756, 571, 197, 3417, 22050, 298, 9859, 18896, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 25243, 2812, 11, 8318, 15867, 5548, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 2120, 1180, 25, 1818, 1180, 515, 571, 197, 12245, 3144, 14335, 2648, 25, 2415, 14032, 30953, 515, 464, 197, 61593, 788, 1060, 330, 2428, 1110, 2408, 2268, 651, 756, 464, 197, 1, 2408, 71184, 788, 260, 330, 2428, 1110, 2408, 18779, 4160, 349, 2268, 651, 756, 464, 197, 1, 2408, 71184, 34198, 5504, 5368, 788, 330, 2428, 1110, 847, 29177, 2268, 651, 756, 571, 197, 3417, 22050, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 20629, 431, 261, 359, 5087, 2648, 323, 431, 261, 359, 5087, 84905, 525, 8318, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 39368, 25, 28416, 515, 571, 11143, 261, 359, 5087, 2648, 25, 220, 609, 79, 651, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 1583, 571, 11143, 261, 359, 5087, 84905, 25, 431, 261, 359, 5087, 84905, 4913, 9, 788, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 22050, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 49, 261, 359, 5087, 2648, 323, 537, 431, 261, 359, 5087, 84905, 374, 2697, 11, 902, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 39368, 25, 28416, 515, 571, 11143, 261, 359, 5087, 2648, 25, 609, 79, 651, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 895, 11, 32095, 7137, 25, 3056, 917, 4913, 901, 1783, 43674, 48085, 298, 197, 74869, 298, 9859, 18896, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 49, 261, 359, 5087, 2648, 1172, 323, 10519, 14525, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 39368, 25, 28416, 515, 571, 11143, 261, 359, 5087, 2648, 25, 609, 79, 651, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 11, 32095, 7137, 25, 3056, 917, 4913, 901, 1783, 43674, 48085, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 49, 261, 359, 5087, 84905, 323, 537, 431, 261, 359, 5087, 2648, 374, 2697, 11, 902, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 39368, 25, 28416, 515, 571, 11143, 261, 359, 5087, 84905, 25, 431, 261, 359, 5087, 84905, 515, 464, 197, 61593, 788, 3824, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 1583, 464, 197, 62911, 29827, 788, 310, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 75615, 7137, 25, 3056, 917, 4913, 68, 2300, 65, 27297, 48085, 464, 197, 62911, 29827, 79587, 788, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 75615, 42437, 82, 25, 3056, 917, 4913, 74, 29827, 497, 330, 74, 29827, 1331, 14462, 48085, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 895, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 49, 261, 359, 5087, 84905, 1172, 323, 10519, 14525, 11, 1848, 756, 298, 25873, 25, 609, 2648, 90, 47, 651, 2648, 25, 393, 651, 2648, 90, 39368, 25, 28416, 515, 571, 11143, 261, 359, 5087, 84905, 25, 431, 261, 359, 5087, 84905, 515, 464, 197, 61593, 788, 3824, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 1583, 464, 197, 62911, 29827, 788, 310, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 75615, 7137, 25, 3056, 917, 4913, 68, 2300, 65, 27297, 48085, 464, 197, 62911, 29827, 79587, 788, 47558, 2068, 2013, 261, 359, 5087, 2648, 90, 18605, 40695, 25, 830, 11, 32095, 42437, 82, 25, 3056, 917, 4913, 74, 29827, 497, 330, 74, 29827, 1331, 14462, 48085, 571, 197, 1583, 298, 197, 74869, 298, 9859, 18896, 25, 830, 345, 197, 197, 1583, 197, 630, 2023, 8358, 17130, 1669, 2088, 1273, 37302, 341, 197, 3244, 16708, 44415, 2644, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 743, 702, 7747, 1669, 17130, 5423, 19520, 2189, 2648, 368, 961, 2092, 26, 702, 7747, 961, 17130, 18441, 18896, 341, 571, 3244, 13080, 445, 7325, 1848, 25, 1018, 83, 714, 572, 1018, 83, 497, 17130, 18441, 18896, 11, 702, 7747, 340, 298, 197, 532, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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L: String(""), Name: String(""), Label: String(""), State: String(""), ContentType: String(""), Size: Int(0), DownloadCount: Int(0), CreatedAt: &Timestamp{}, UpdatedAt: &Timestamp{}, BrowserDownloadURL: String(""), Uploader: &User{}, NodeID: String(""), } want := `github.ReleaseAsset{ID:0, URL:"", Name:"", Label:"", State:"", ContentType:"", Size:0, DownloadCount:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, BrowserDownloadURL:"", Uploader:github.User{}, NodeID:""}` if got := v.String(); got != want { t.Errorf("ReleaseAsset.String = %v, want %v", got, want) } }
explode_data.jsonl/33280
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 425 }
[ 2830, 3393, 16077, 16604, 31777, 1155, 353, 8840, 836, 8, 341, 5195, 1669, 17381, 16604, 515, 197, 29580, 25, 338, 1333, 21, 19, 7, 15, 1326, 197, 79055, 25, 394, 923, 445, 4461, 197, 21297, 25, 2290, 923, 445, 4461, 197, 82126, 25, 1060, 923, 445, 4461, 197, 76424, 25, 1060, 923, 445, 4461, 197, 197, 29504, 25, 286, 923, 445, 4461, 197, 91224, 25, 2290, 1333, 7, 15, 1326, 197, 197, 11377, 2507, 25, 414, 1333, 7, 15, 1326, 197, 84062, 1655, 25, 688, 609, 20812, 38837, 197, 197, 72279, 25, 688, 609, 20812, 38837, 197, 12791, 4012, 11377, 3144, 25, 923, 445, 4461, 197, 197, 67574, 25, 1843, 609, 1474, 38837, 197, 30217, 915, 25, 1797, 923, 445, 4461, 197, 532, 50780, 1669, 1565, 5204, 58693, 16604, 90, 915, 25, 15, 11, 5548, 83131, 3988, 83131, 9402, 83131, 3234, 83131, 70431, 83131, 8478, 25, 15, 11, 8577, 2507, 25, 15, 11, 4290, 1655, 25, 5204, 49024, 90, 15, 15, 15, 16, 12, 15, 16, 12, 15, 16, 220, 15, 15, 25, 15, 15, 25, 15, 15, 488, 15, 15, 15, 15, 27403, 2137, 16073, 1655, 25, 5204, 49024, 90, 15, 15, 15, 16, 12, 15, 16, 12, 15, 16, 220, 15, 15, 25, 15, 15, 25, 15, 15, 488, 15, 15, 15, 15, 27403, 2137, 16482, 11377, 3144, 83131, 3138, 8355, 25, 5204, 7344, 22655, 6018, 915, 2974, 9207, 3989, 743, 2684, 1669, 348, 6431, 2129, 2684, 961, 1366, 341, 197, 3244, 13080, 445, 16077, 16604, 6431, 284, 1018, 85, 11, 1366, 1018, 85, 497, 2684, 11, 1366, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestHealthWithBogusCheck(t *testing.T) { h := New() err := h.RegisterCheck(&Config{ ExecutionPeriod: 1, InitialDelay: 1, }) defer h.DeregisterAll() assert.Error(t, err, "register bogus check should fail") assert.Contains(t, err.Error(), "misconfigured check", "fail message") assert.True(t, h.IsHealthy(), "health after bogus register") results, healthy := h.Results() assert.True(t, healthy, "results after bogus register") assert.Empty(t, results, "results after bogus register") }
explode_data.jsonl/28828
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 174 }
[ 2830, 3393, 14542, 2354, 33, 538, 355, 3973, 1155, 353, 8840, 836, 8, 341, 9598, 1669, 1532, 2822, 9859, 1669, 305, 19983, 3973, 2099, 2648, 515, 197, 197, 20294, 23750, 25, 220, 16, 345, 197, 197, 6341, 20039, 25, 262, 220, 16, 345, 197, 3518, 16867, 305, 909, 52633, 1571, 2403, 2822, 6948, 6141, 1155, 11, 1848, 11, 330, 6343, 59920, 1779, 1265, 3690, 1138, 6948, 11545, 1155, 11, 1848, 6141, 1507, 330, 33865, 81443, 1779, 497, 330, 18403, 1943, 1138, 6948, 32443, 1155, 11, 305, 4506, 96113, 1507, 330, 12120, 1283, 59920, 4161, 5130, 55497, 11, 9314, 1669, 305, 62440, 741, 6948, 32443, 1155, 11, 9314, 11, 330, 8074, 1283, 59920, 4161, 1138, 6948, 11180, 1155, 11, 3059, 11, 330, 8074, 1283, 59920, 4161, 1138, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestBadConn(t *testing.T) { var err error cn := conn{} func() { defer cn.errRecover(&err) panic(io.EOF) }() if err != driver.ErrBadConn { t.Fatalf("expected driver.ErrBadConn, got: %#v", err) } if !cn.bad { t.Fatalf("expected cn.bad") } cn = conn{} func() { defer cn.errRecover(&err) e := &Error{Severity: Efatal} panic(e) }() if err != driver.ErrBadConn { t.Fatalf("expected driver.ErrBadConn, got: %#v", err) } if !cn.bad { t.Fatalf("expected cn.bad") } }
explode_data.jsonl/73482
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 240 }
[ 2830, 3393, 17082, 9701, 1155, 353, 8840, 836, 8, 341, 2405, 1848, 1465, 271, 1444, 77, 1669, 4534, 16094, 29244, 368, 341, 197, 16867, 13665, 18441, 693, 3688, 2099, 615, 340, 197, 30764, 37258, 86492, 340, 197, 69826, 743, 1848, 961, 5579, 27862, 17082, 9701, 341, 197, 3244, 30762, 445, 7325, 5579, 27862, 17082, 9701, 11, 2684, 25, 52406, 85, 497, 1848, 340, 197, 532, 743, 753, 14271, 31563, 341, 197, 3244, 30762, 445, 7325, 13665, 31563, 1138, 197, 630, 1444, 77, 284, 4534, 16094, 29244, 368, 341, 197, 16867, 13665, 18441, 693, 3688, 2099, 615, 340, 197, 7727, 1669, 609, 1454, 90, 65594, 25, 468, 74394, 532, 197, 30764, 2026, 340, 197, 69826, 743, 1848, 961, 5579, 27862, 17082, 9701, 341, 197, 3244, 30762, 445, 7325, 5579, 27862, 17082, 9701, 11, 2684, 25, 52406, 85, 497, 1848, 340, 197, 532, 743, 753, 14271, 31563, 341, 197, 3244, 30762, 445, 7325, 13665, 31563, 1138, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAllocateTokensTruncation(t *testing.T) { communityTax := sdk.NewDec(0) ctx, _, _, k, sk, fck, _ := CreateTestInputAdvanced(t, false, 1000000, communityTax) fmt.Println("====", k.GetCommunityTax(ctx)) sh := staking.NewHandler(sk) // create validator with 10% commission commission := staking.NewCommissionMsg(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) msg := staking.NewMsgCreateValidator(valOpAddr1, valConsPk1, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(110)), staking.Description{}, commission, sdk.OneInt(), sdk.OneInt(), sdk.OneInt()) require.True(t, sh(ctx, msg).IsOK()) // create second validator with 10% commission commission = staking.NewCommissionMsg(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) msg = staking.NewMsgCreateValidator(valOpAddr2, valConsPk2, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), staking.Description{}, commission, sdk.OneInt(), sdk.OneInt(), sdk.OneInt()) require.True(t, sh(ctx, msg).IsOK()) // create third validator with 10% commission commission = staking.NewCommissionMsg(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) msg = staking.NewMsgCreateValidator(valOpAddr3, valConsPk3, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), staking.Description{}, commission, sdk.OneInt(), sdk.OneInt(), sdk.OneInt()) require.True(t, sh(ctx, msg).IsOK()) abciValA := abci.Validator{ Address: valConsPk1.Address(), Power: 11, } abciValB := abci.Validator{ Address: valConsPk2.Address(), Power: 10, } abciValС := abci.Validator{ Address: valConsPk3.Address(), Power: 10, } // assert initial state: zero outstanding rewards, zero community pool, zero commission, zero current rewards require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr1).IsZero()) require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr2).IsZero()) require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr3).IsZero()) require.True(t, k.GetFeePool(ctx).CommunityPool.IsZero()) require.True(t, k.GetValidatorAccumulatedCommission(ctx, valOpAddr1).IsZero()) require.True(t, k.GetValidatorAccumulatedCommission(ctx, valOpAddr2).IsZero()) require.True(t, k.GetValidatorCurrentRewards(ctx, valOpAddr1).Rewards.IsZero()) require.True(t, k.GetValidatorCurrentRewards(ctx, valOpAddr2).Rewards.IsZero()) // allocate tokens as if both had voted and second was proposer fees := sdk.Coins{ sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(634195840)), } fck.SetCollectedFees(fees) votes := []abci.VoteInfo{ { Validator: abciValA, SignedLastBlock: true, }, { Validator: abciValB, SignedLastBlock: true, }, { Validator: abciValС, SignedLastBlock: true, }, } k.AllocateTokens(ctx, 31, 31, valConsAddr2, votes) require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr1).IsValid()) require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr2).IsValid()) require.True(t, k.GetValidatorOutstandingRewards(ctx, valOpAddr3).IsValid()) }
explode_data.jsonl/45678
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1219 }
[ 2830, 3393, 75380, 29300, 1282, 1347, 367, 1155, 353, 8840, 836, 8, 341, 197, 28402, 31349, 1669, 45402, 7121, 4900, 7, 15, 340, 20985, 11, 8358, 8358, 595, 11, 1901, 11, 282, 377, 11, 716, 1669, 4230, 2271, 2505, 35457, 1155, 11, 895, 11, 220, 16, 15, 15, 15, 15, 15, 15, 11, 3942, 31349, 340, 11009, 12419, 445, 605, 497, 595, 2234, 33768, 31349, 7502, 1171, 36196, 1669, 357, 1765, 7121, 3050, 68907, 692, 197, 322, 1855, 22935, 448, 220, 16, 15, 4, 12123, 198, 32810, 2728, 1669, 357, 1765, 7121, 73750, 6611, 1141, 7584, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 7, 15, 1171, 21169, 1669, 357, 1765, 7121, 6611, 4021, 14256, 9098, 7125, 13986, 16, 11, 1044, 15220, 58415, 16, 345, 197, 1903, 7584, 7121, 41180, 1141, 7584, 13275, 89844, 23619, 316, 11, 45402, 7121, 1072, 7, 16, 16, 15, 5731, 357, 1765, 28773, 22655, 12123, 11, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 2398, 17957, 32443, 1155, 11, 557, 7502, 11, 3750, 568, 3872, 3925, 12367, 197, 322, 1855, 2086, 22935, 448, 220, 16, 15, 4, 12123, 198, 32810, 2728, 284, 357, 1765, 7121, 73750, 6611, 1141, 7584, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 7, 15, 1171, 21169, 284, 357, 1765, 7121, 6611, 4021, 14256, 9098, 7125, 13986, 17, 11, 1044, 15220, 58415, 17, 345, 197, 1903, 7584, 7121, 41180, 1141, 7584, 13275, 89844, 23619, 316, 11, 45402, 7121, 1072, 7, 16, 15, 15, 5731, 357, 1765, 28773, 22655, 12123, 11, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 2398, 17957, 32443, 1155, 11, 557, 7502, 11, 3750, 568, 3872, 3925, 12367, 197, 322, 1855, 4843, 22935, 448, 220, 16, 15, 4, 12123, 198, 32810, 2728, 284, 357, 1765, 7121, 73750, 6611, 1141, 7584, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 2354, 68833, 7, 16, 11, 220, 16, 701, 45402, 7121, 4900, 7, 15, 1171, 21169, 284, 357, 1765, 7121, 6611, 4021, 14256, 9098, 7125, 13986, 18, 11, 1044, 15220, 58415, 18, 345, 197, 1903, 7584, 7121, 41180, 1141, 7584, 13275, 89844, 23619, 316, 11, 45402, 7121, 1072, 7, 16, 15, 15, 5731, 357, 1765, 28773, 22655, 12123, 11, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 1507, 45402, 37067, 1072, 2398, 17957, 32443, 1155, 11, 557, 7502, 11, 3750, 568, 3872, 3925, 12367, 197, 370, 5855, 2208, 32, 1669, 668, 5855, 13, 14256, 515, 197, 98090, 25, 1044, 15220, 58415, 16, 26979, 3148, 197, 10025, 1202, 25, 256, 220, 16, 16, 345, 197, 532, 197, 370, 5855, 2208, 33, 1669, 668, 5855, 13, 14256, 515, 197, 98090, 25, 1044, 15220, 58415, 17, 26979, 3148, 197, 10025, 1202, 25, 256, 220, 16, 15, 345, 197, 532, 197, 370, 5855, 2208, 19311, 1669, 668, 5855, 13, 14256, 515, 197, 98090, 25, 1044, 15220, 58415, 18, 26979, 3148, 197, 10025, 1202, 25, 256, 220, 16, 15, 345, 197, 630, 197, 322, 2060, 2856, 1584, 25, 7168, 18781, 21160, 11, 7168, 3942, 7314, 11, 7168, 12123, 11, 7168, 1482, 21160, 198, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 16, 568, 3872, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 17, 568, 3872, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 18, 568, 3872, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 41941, 10551, 7502, 568, 33768, 10551, 4506, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 14603, 372, 7757, 73750, 7502, 11, 1044, 7125, 13986, 16, 568, 3872, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 14603, 372, 7757, 73750, 7502, 11, 1044, 7125, 13986, 17, 568, 3872, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 5405, 58465, 2347, 7502, 11, 1044, 7125, 13986, 16, 568, 58465, 2347, 4506, 17999, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 5405, 58465, 2347, 7502, 11, 1044, 7125, 13986, 17, 568, 58465, 2347, 4506, 17999, 12367, 197, 322, 22089, 11211, 438, 421, 2176, 1030, 16228, 323, 2086, 572, 9844, 261, 198, 1166, 5516, 1669, 45402, 52114, 1330, 515, 197, 1903, 7584, 7121, 41180, 1141, 7584, 13275, 89844, 23619, 316, 11, 45402, 7121, 1072, 7, 21, 18, 19, 16, 24, 20, 23, 19, 15, 6965, 197, 532, 1166, 377, 4202, 6127, 2209, 37, 5516, 955, 5516, 340, 5195, 6295, 1669, 3056, 370, 5855, 5058, 1272, 1731, 515, 197, 197, 515, 298, 197, 14256, 25, 981, 668, 5855, 2208, 32, 345, 298, 7568, 1542, 5842, 4713, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 197, 14256, 25, 981, 668, 5855, 2208, 33, 345, 298, 7568, 1542, 5842, 4713, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 197, 14256, 25, 981, 668, 5855, 2208, 19311, 345, 298, 7568, 1542, 5842, 4713, 25, 830, 345, 197, 197, 1583, 197, 532, 16463, 9636, 22401, 29300, 7502, 11, 220, 18, 16, 11, 220, 18, 16, 11, 1044, 15220, 13986, 17, 11, 12684, 692, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 16, 568, 55470, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 17, 568, 55470, 2398, 17957, 32443, 1155, 11, 595, 2234, 14256, 2662, 10070, 58465, 2347, 7502, 11, 1044, 7125, 13986, 18, 568, 55470, 2398, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUGlobalLongShortRatio(t *testing.T) { t.Parallel() _, err := b.UGlobalLongShortRatio(context.Background(), currency.NewPair(currency.BTC, currency.USDT), "5m", 3, time.Time{}, time.Time{}) if err != nil { t.Error(err) } _, err = b.UGlobalLongShortRatio(context.Background(), currency.NewPair(currency.BTC, currency.USDT), "4h", 0, time.Unix(1577836800, 0), time.Unix(1580515200, 0)) if err != nil { t.Error(err) } }
explode_data.jsonl/76567
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 178 }
[ 2830, 3393, 2941, 2042, 6583, 12472, 22777, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 197, 6878, 1848, 1669, 293, 13, 2941, 2042, 6583, 12472, 22777, 5378, 19047, 1507, 11413, 7121, 12443, 90475, 1785, 7749, 11, 11413, 67672, 10599, 701, 330, 20, 76, 497, 220, 18, 11, 882, 16299, 22655, 882, 16299, 37790, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 3964, 340, 197, 532, 197, 6878, 1848, 284, 293, 13, 2941, 2042, 6583, 12472, 22777, 5378, 19047, 1507, 11413, 7121, 12443, 90475, 1785, 7749, 11, 11413, 67672, 10599, 701, 330, 19, 71, 497, 220, 15, 11, 882, 10616, 941, 7, 16, 20, 22, 22, 23, 18, 21, 23, 15, 15, 11, 220, 15, 701, 882, 10616, 941, 7, 16, 20, 23, 15, 20, 16, 20, 17, 15, 15, 11, 220, 15, 1171, 743, 1848, 961, 2092, 341, 197, 3244, 6141, 3964, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestIAVLDefaultPruning(t *testing.T) { //Expected stored / deleted version numbers for: //numRecent = 5, storeEvery = 3 var states = []pruneState{ {[]int64{}, []int64{}}, {[]int64{1}, []int64{}}, {[]int64{1, 2}, []int64{}}, {[]int64{1, 2, 3}, []int64{}}, {[]int64{1, 2, 3, 4}, []int64{}}, {[]int64{1, 2, 3, 4, 5}, []int64{}}, {[]int64{1, 2, 3, 4, 5, 6}, []int64{}}, {[]int64{2, 3, 4, 5, 6, 7}, []int64{1}}, {[]int64{3, 4, 5, 6, 7, 8}, []int64{1, 2}}, {[]int64{3, 4, 5, 6, 7, 8, 9}, []int64{1, 2}}, {[]int64{3, 5, 6, 7, 8, 9, 10}, []int64{1, 2, 4}}, {[]int64{3, 6, 7, 8, 9, 10, 11}, []int64{1, 2, 4, 5}}, {[]int64{3, 6, 7, 8, 9, 10, 11, 12}, []int64{1, 2, 4, 5}}, {[]int64{3, 6, 8, 9, 10, 11, 12, 13}, []int64{1, 2, 4, 5, 7}}, {[]int64{3, 6, 9, 10, 11, 12, 13, 14}, []int64{1, 2, 4, 5, 7, 8}}, {[]int64{3, 6, 9, 10, 11, 12, 13, 14, 15}, []int64{1, 2, 4, 5, 7, 8}}, } testPruning(t, int64(5), int64(3), states) }
explode_data.jsonl/44275
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 532 }
[ 2830, 3393, 5863, 30698, 3675, 3533, 37202, 1155, 353, 8840, 836, 8, 341, 197, 322, 18896, 9768, 608, 11062, 2319, 5109, 369, 510, 197, 322, 2413, 25140, 284, 220, 20, 11, 3553, 11510, 284, 220, 18, 198, 2405, 5302, 284, 3056, 649, 2886, 1397, 515, 197, 197, 90, 1294, 396, 21, 19, 22655, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 11, 220, 17, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 18, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 2137, 3056, 396, 21, 19, 6257, 1583, 197, 197, 90, 1294, 396, 21, 19, 90, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 11, 220, 22, 2137, 3056, 396, 21, 19, 90, 16, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 11, 220, 22, 11, 220, 23, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 11, 220, 22, 11, 220, 23, 11, 220, 24, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 20, 11, 220, 21, 11, 220, 22, 11, 220, 23, 11, 220, 24, 11, 220, 16, 15, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 21, 11, 220, 22, 11, 220, 23, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 16, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 11, 220, 20, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 21, 11, 220, 22, 11, 220, 23, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 16, 11, 220, 16, 17, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 11, 220, 20, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 21, 11, 220, 23, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 16, 11, 220, 16, 17, 11, 220, 16, 18, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 11, 220, 20, 11, 220, 22, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 21, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 16, 11, 220, 16, 17, 11, 220, 16, 18, 11, 220, 16, 19, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 11, 220, 20, 11, 220, 22, 11, 220, 23, 22050, 197, 197, 90, 1294, 396, 21, 19, 90, 18, 11, 220, 21, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 16, 11, 220, 16, 17, 11, 220, 16, 18, 11, 220, 16, 19, 11, 220, 16, 20, 2137, 3056, 396, 21, 19, 90, 16, 11, 220, 17, 11, 220, 19, 11, 220, 20, 11, 220, 22, 11, 220, 23, 22050, 197, 532, 18185, 3533, 37202, 1155, 11, 526, 21, 19, 7, 20, 701, 526, 21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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestServerRejectHeadWithBody(t *testing.T) { st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { // No response body. }) defer st.Close() st.greet() st.writeHeaders(HeadersFrameParam{ StreamID: 1, // clients send odd numbers BlockFragment: st.encodeHeader(":method", "HEAD"), EndStream: false, // what we're testing, a bogus HEAD request with body EndHeaders: true, }) st.wantRSTStream(1, ErrCodeProtocol) }
explode_data.jsonl/71694
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 175 }
[ 2830, 3393, 5475, 78413, 12346, 2354, 5444, 1155, 353, 8840, 836, 8, 341, 18388, 1669, 501, 5475, 58699, 1155, 11, 2915, 3622, 1758, 37508, 11, 435, 353, 1254, 9659, 8, 341, 197, 197, 322, 2308, 2033, 2487, 624, 197, 3518, 16867, 357, 10421, 741, 18388, 1302, 3744, 741, 18388, 3836, 10574, 7, 10574, 4369, 2001, 515, 197, 197, 3027, 915, 25, 414, 220, 16, 11, 442, 8239, 3624, 10322, 5109, 198, 197, 94940, 9488, 25, 357, 17313, 4047, 18893, 4393, 497, 330, 35433, 4461, 197, 38407, 3027, 25, 257, 895, 11, 442, 1128, 582, 2299, 7497, 11, 264, 59920, 33080, 1681, 448, 2487, 198, 197, 38407, 10574, 25, 262, 830, 345, 197, 3518, 18388, 70212, 49, 784, 3027, 7, 16, 11, 15495, 2078, 20689, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestOrderCountMetafields(t *testing.T) { setup() defer teardown() httpmock.RegisterResponder("GET", fmt.Sprintf("https://fooshop.myshopify.com/%s/orders/1/metafields/count.json", client.pathPrefix), httpmock.NewStringResponder(200, `{"count": 3}`)) params := map[string]string{"created_at_min": "2016-01-01T00:00:00Z"} httpmock.RegisterResponderWithQuery( "GET", fmt.Sprintf("https://fooshop.myshopify.com/%s/orders/1/metafields/count.json", client.pathPrefix), params, httpmock.NewStringResponder(200, `{"count": 2}`)) cnt, err := client.Order.CountMetafields(1, nil) if err != nil { t.Errorf("Order.CountMetafields() returned error: %v", err) } expected := 3 if cnt != expected { t.Errorf("Order.CountMetafields() returned %d, expected %d", cnt, expected) } date := time.Date(2016, time.January, 1, 0, 0, 0, 0, time.UTC) cnt, err = client.Order.CountMetafields(1, CountOptions{CreatedAtMin: date}) if err != nil { t.Errorf("Order.CountMetafields() returned error: %v", err) } expected = 2 if cnt != expected { t.Errorf("Order.CountMetafields() returned %d, expected %d", cnt, expected) } }
explode_data.jsonl/17993
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 454 }
[ 2830, 3393, 4431, 2507, 12175, 9007, 1155, 353, 8840, 836, 8, 341, 84571, 741, 16867, 49304, 2822, 28080, 16712, 19983, 30884, 445, 3806, 497, 8879, 17305, 445, 2428, 1110, 824, 9267, 453, 12618, 8675, 1437, 905, 12627, 82, 82818, 14, 16, 69207, 9007, 81043, 4323, 497, 2943, 3875, 14335, 1326, 197, 28080, 16712, 7121, 703, 30884, 7, 17, 15, 15, 11, 1565, 4913, 1830, 788, 220, 18, 5541, 4390, 25856, 1669, 2415, 14032, 30953, 4913, 7120, 3752, 7260, 788, 330, 17, 15, 16, 21, 12, 15, 16, 12, 15, 16, 51, 15, 15, 25, 15, 15, 25, 15, 15, 57, 16707, 28080, 16712, 19983, 30884, 2354, 2859, 1006, 197, 197, 1, 3806, 756, 197, 11009, 17305, 445, 2428, 1110, 824, 9267, 453, 12618, 8675, 1437, 905, 12627, 82, 82818, 14, 16, 69207, 9007, 81043, 4323, 497, 2943, 3875, 14335, 1326, 197, 25856, 345, 197, 28080, 16712, 7121, 703, 30884, 7, 17, 15, 15, 11, 1565, 4913, 1830, 788, 220, 17, 5541, 4390, 60553, 11, 1848, 1669, 2943, 19664, 6134, 12175, 9007, 7, 16, 11, 2092, 340, 743, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 4431, 6134, 12175, 9007, 368, 5927, 1465, 25, 1018, 85, 497, 1848, 340, 197, 630, 42400, 1669, 220, 18, 198, 743, 13195, 961, 3601, 341, 197, 3244, 13080, 445, 4431, 6134, 12175, 9007, 368, 5927, 1018, 67, 11, 3601, 1018, 67, 497, 13195, 11, 3601, 340, 197, 630, 44086, 1669, 882, 8518, 7, 17, 15, 16, 21, 11, 882, 3503, 276, 3536, 11, 220, 16, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 882, 87069, 340, 60553, 11, 1848, 284, 2943, 19664, 6134, 12175, 9007, 7, 16, 11, 4504, 3798, 90, 70387, 6217, 25, 2400, 3518, 743, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 4431, 6134, 12175, 9007, 368, 5927, 1465, 25, 1018, 85, 497, 1848, 340, 197, 630, 42400, 284, 220, 17, 198, 743, 13195, 961, 3601, 341, 197, 3244, 13080, 445, 4431, 6134, 12175, 9007, 368, 5927, 1018, 67, 11, 3601, 1018, 67, 497, 13195, 11, 3601, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_DeleteVote(t *testing.T) { if testUser == nil || testUser.Id < 1 || testMovie == nil || testMovie.Id < 1 || testCycle == nil || testCycle.Id < 1 { t.Skip("Skipping due to previous failure") } err := conn.DeleteVote(testUser.Id, testMovie.Id) if err != nil { t.Fatal(err) } }
explode_data.jsonl/22023
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 119 }
[ 2830, 3393, 57418, 41412, 1155, 353, 8840, 836, 8, 341, 743, 1273, 1474, 621, 2092, 1369, 1273, 1474, 6444, 366, 220, 16, 8244, 197, 18185, 19668, 621, 2092, 1369, 1273, 19668, 6444, 366, 220, 16, 8244, 197, 18185, 44820, 621, 2092, 1369, 1273, 44820, 6444, 366, 220, 16, 341, 197, 3244, 57776, 445, 85945, 4152, 311, 3681, 7901, 1138, 197, 630, 9859, 1669, 4534, 18872, 41412, 8623, 1474, 6444, 11, 1273, 19668, 6444, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestStrArray_FilterEmpty(t *testing.T) { gtest.C(t, func(t *gtest.T) { array := garray.NewStrArrayFrom(g.SliceStr{"", "1", "2", "0"}) t.Assert(array.FilterEmpty(), g.SliceStr{"1", "2", "0"}) }) gtest.C(t, func(t *gtest.T) { array := garray.NewStrArrayFrom(g.SliceStr{"1", "2"}) t.Assert(array.FilterEmpty(), g.SliceStr{"1", "2"}) }) }
explode_data.jsonl/53117
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 169 }
[ 2830, 3393, 2580, 1857, 68935, 3522, 1155, 353, 8840, 836, 8, 341, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 11923, 1669, 342, 1653, 7121, 2580, 1857, 3830, 3268, 95495, 2580, 4913, 497, 330, 16, 497, 330, 17, 497, 330, 15, 23625, 197, 3244, 11711, 6110, 31696, 3522, 1507, 342, 95495, 2580, 4913, 16, 497, 330, 17, 497, 330, 15, 23625, 197, 3518, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 11923, 1669, 342, 1653, 7121, 2580, 1857, 3830, 3268, 95495, 2580, 4913, 16, 497, 330, 17, 23625, 197, 3244, 11711, 6110, 31696, 3522, 1507, 342, 95495, 2580, 4913, 16, 497, 330, 17, 23625, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPrint(t *testing.T) { data := []byte(`{ "Name": "some-name", "Project": "some-project", "Zone": "some-zone", "GCSPath": "gs://some-bucket/images", "Vars": { "instance_name": "i1", "machine_type": {"Value": "n1-standard-1", "Required": true} }, "Steps": { "${instance_name}Delete": { "DeleteResources": { "Instances": ["${instance_name}"] } } } }`) want := `{ "Name": "some-name", "Project": "some-project", "Zone": "some-zone", "GCSPath": "gs://some-bucket/images", "Vars": { "instance_name": { "Value": "i1" }, "machine_type": { "Value": "n1-standard-1", "Required": true } }, "Steps": { "i1Delete": { "Timeout": "10m", "DeleteResources": { "Instances": [ "i1" ] } } }, "DefaultTimeout": "10m", "ForceCleanupOnError": false } ` td, err := ioutil.TempDir(os.TempDir(), "") if err != nil { t.Fatalf("error creating temp dir: %v", err) } defer os.RemoveAll(td) tf := filepath.Join(td, "test.wf.json") ioutil.WriteFile(tf, data, 0600) got, err := NewFromFile(tf) if err != nil { t.Fatal(err) } got.ComputeClient, _ = newTestGCEClient() got.StorageClient, _ = newTestGCSClient() old := os.Stdout r, w, err := os.Pipe() if err != nil { t.Fatal(err) } os.Stdout = w got.Print(context.Background()) w.Close() os.Stdout = old var buf bytes.Buffer if _, err := io.Copy(&buf, r); err != nil { t.Fatal(err) } if diffRes := diff(buf.String(), want, 0); diffRes != "" { t.Errorf("printed workflow does not match expectation: (-got +want)\n%s", diffRes) } }
explode_data.jsonl/3882
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 736 }
[ 2830, 3393, 8994, 1155, 353, 8840, 836, 8, 341, 8924, 1669, 3056, 3782, 5809, 515, 1, 675, 788, 330, 14689, 11494, 756, 1, 7849, 788, 330, 14689, 33696, 756, 1, 15363, 788, 330, 14689, 77763, 756, 89199, 6412, 1820, 788, 330, 5857, 1110, 14689, 1455, 11152, 9737, 756, 1, 28305, 788, 341, 220, 330, 4851, 1269, 788, 330, 72, 16, 756, 220, 330, 32056, 1819, 788, 5212, 1130, 788, 330, 77, 16, 53820, 12, 16, 497, 330, 8164, 788, 830, 532, 1583, 1, 33951, 788, 341, 220, 10857, 4851, 1269, 92, 6435, 788, 341, 262, 330, 6435, 11277, 788, 341, 414, 330, 42725, 788, 4383, 2365, 4851, 1269, 92, 7026, 262, 456, 220, 456, 532, 5541, 692, 50780, 1669, 1565, 515, 220, 330, 675, 788, 330, 14689, 11494, 756, 220, 330, 7849, 788, 330, 14689, 33696, 756, 220, 330, 15363, 788, 330, 14689, 77763, 756, 220, 330, 38, 6412, 1820, 788, 330, 5857, 1110, 14689, 1455, 11152, 9737, 756, 220, 330, 28305, 788, 341, 262, 330, 4851, 1269, 788, 341, 414, 330, 1130, 788, 330, 72, 16, 698, 262, 1153, 262, 330, 32056, 1819, 788, 341, 414, 330, 1130, 788, 330, 77, 16, 53820, 12, 16, 756, 414, 330, 8164, 788, 830, 198, 262, 456, 220, 1153, 220, 330, 33951, 788, 341, 262, 330, 72, 16, 6435, 788, 341, 414, 330, 7636, 788, 330, 16, 15, 76, 756, 414, 330, 6435, 11277, 788, 341, 286, 330, 42725, 788, 2278, 688, 330, 72, 16, 698, 286, 5133, 414, 456, 262, 456, 220, 1153, 220, 330, 3675, 7636, 788, 330, 16, 15, 76, 756, 220, 330, 18573, 67335, 74945, 788, 895, 198, 532, 19324, 76373, 11, 1848, 1669, 43144, 65009, 6184, 9638, 65009, 6184, 1507, 14676, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 841, 6825, 2730, 5419, 25, 1018, 85, 497, 1848, 340, 197, 532, 16867, 2643, 84427, 61241, 340, 3244, 69, 1669, 26054, 22363, 61241, 11, 330, 1944, 1418, 69, 4323, 1138, 8230, 30158, 4073, 1703, 19916, 11, 821, 11, 220, 15, 21, 15, 15, 692, 3174, 354, 11, 1848, 1669, 1532, 43633, 19916, 340, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 3174, 354, 89237, 2959, 11, 716, 284, 501, 2271, 38, 2104, 2959, 741, 3174, 354, 43771, 2959, 11, 716, 284, 501, 2271, 38, 6412, 2959, 2822, 61828, 1669, 2643, 83225, 198, 7000, 11, 289, 11, 1848, 1669, 2643, 1069, 3444, 741, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 25078, 83225, 284, 289, 198, 3174, 354, 7918, 5378, 19047, 2398, 6692, 10421, 741, 25078, 83225, 284, 2310, 198, 2405, 6607, 5820, 22622, 198, 743, 8358, 1848, 1669, 6399, 31770, 2099, 5909, 11, 435, 1215, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 743, 3638, 1061, 1669, 3638, 10731, 6431, 1507, 1366, 11, 220, 15, 1215, 3638, 1061, 961, 1591, 341, 197, 3244, 13080, 445, 52213, 28288, 1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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestOVSBridgeExternalIDs(t *testing.T) { data := &testData{} data.setup(t) defer data.teardown(t) returnedIDs, err := data.br.GetExternalIDs() require.Nil(t, err, "Failed to get external IDs of the bridge") assert.Empty(t, returnedIDs) providedIDs := map[string]interface{}{"k1": "v1", "k2": "v2"} err = data.br.SetExternalIDs(providedIDs) require.Nil(t, err, "Failed to set external IDs to the bridge") returnedIDs, err = data.br.GetExternalIDs() require.Nil(t, err, "Failed to get external IDs of the bridge") for k, v := range providedIDs { rv, ok := returnedIDs[k] if !assert.Truef(t, ok, "Returned external IDs do not include the expected ID: %s:%s", k, v) { continue } assert.Equalf(t, v.(string), rv, "Returned external IDs include an ID with an unexpected value: %s:%s", k, v) } }
explode_data.jsonl/74750
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 311 }
[ 2830, 3393, 38957, 16680, 11183, 25913, 30466, 1155, 353, 8840, 836, 8, 341, 8924, 1669, 609, 1944, 1043, 16094, 8924, 25338, 1155, 340, 16867, 821, 31853, 37496, 1155, 692, 853, 291, 30466, 11, 1848, 1669, 821, 20937, 2234, 25913, 30466, 741, 17957, 59678, 1155, 11, 1848, 11, 330, 9408, 311, 633, 9250, 28360, 315, 279, 14164, 1138, 6948, 11180, 1155, 11, 5927, 30466, 692, 197, 63425, 30466, 1669, 2415, 14032, 31344, 6257, 4913, 74, 16, 788, 330, 85, 16, 497, 330, 74, 17, 788, 330, 85, 17, 16707, 9859, 284, 821, 20937, 4202, 25913, 30466, 10340, 42957, 30466, 340, 17957, 59678, 1155, 11, 1848, 11, 330, 9408, 311, 738, 9250, 28360, 311, 279, 14164, 5130, 853, 291, 30466, 11, 1848, 284, 821, 20937, 2234, 25913, 30466, 741, 17957, 59678, 1155, 11, 1848, 11, 330, 9408, 311, 633, 9250, 28360, 315, 279, 14164, 1138, 2023, 595, 11, 348, 1669, 2088, 3897, 30466, 341, 197, 78484, 11, 5394, 1669, 5927, 30466, 6732, 921, 197, 743, 753, 2207, 32443, 69, 1155, 11, 5394, 11, 330, 84804, 9250, 28360, 653, 537, 2924, 279, 3601, 3034, 25, 1018, 82, 7533, 82, 497, 595, 11, 348, 8, 341, 298, 11664, 198, 197, 197, 532, 197, 6948, 12808, 69, 1155, 11, 348, 12832, 917, 701, 17570, 11, 330, 84804, 9250, 28360, 2924, 458, 3034, 448, 458, 16500, 897, 25, 1018, 82, 7533, 82, 497, 595, 11, 348, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMultiRangeBoundedBatchScanUnsortedOrder(t *testing.T) { defer leaktest.AfterTest(t)() s, _ := startNoSplitMergeServer(t) ctx := context.TODO() defer s.Stopper().Stop(ctx) db := s.DB() if err := setupMultipleRanges(ctx, db, "a", "b", "c", "d", "e", "f"); err != nil { t.Fatal(err) } for _, key := range []string{"a1", "a2", "a3", "b1", "b2", "b3", "b4", "b5", "c1", "c2", "d1", "f1", "f2", "f3"} { if err := db.Put(ctx, key, "value"); err != nil { t.Fatal(err) } } bound := 6 b := &client.Batch{} b.Header.MaxSpanRequestKeys = int64(bound) // Two non-overlapping requests out of order. spans := [][]string{{"b3", "c2"}, {"a", "b3"}} for _, span := range spans { b.Scan(span[0], span[1]) } if err := db.Run(ctx, b); err != nil { t.Fatal(err) } // See incomplete results for the two requests. expResults := [][]string{ {"b3", "b4", "b5"}, {"a1", "a2", "a3"}, } checkScanResults(t, spans, b.Results, expResults, nil /* satisfied */, checkOptions{mode: Strict}) }
explode_data.jsonl/36452
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 453 }
[ 2830, 3393, 20358, 6046, 33, 13082, 21074, 26570, 1806, 28298, 4431, 1155, 353, 8840, 836, 8, 341, 16867, 23352, 1944, 36892, 2271, 1155, 8, 741, 1903, 11, 716, 1669, 1191, 2753, 20193, 52096, 5475, 1155, 340, 20985, 1669, 2266, 90988, 741, 16867, 274, 7758, 18487, 1005, 10674, 7502, 692, 20939, 1669, 274, 22537, 741, 743, 1848, 1669, 6505, 32089, 74902, 7502, 11, 2927, 11, 330, 64, 497, 330, 65, 497, 330, 66, 497, 330, 67, 497, 330, 68, 497, 330, 69, 5038, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 630, 2023, 8358, 1376, 1669, 2088, 3056, 917, 4913, 64, 16, 497, 330, 64, 17, 497, 330, 64, 18, 497, 330, 65, 16, 497, 330, 65, 17, 497, 330, 65, 18, 497, 330, 65, 19, 497, 330, 65, 20, 497, 330, 66, 16, 497, 330, 66, 17, 497, 330, 67, 16, 497, 330, 69, 16, 497, 330, 69, 17, 497, 330, 69, 18, 9207, 341, 197, 743, 1848, 1669, 2927, 39825, 7502, 11, 1376, 11, 330, 957, 5038, 1848, 961, 2092, 341, 298, 3244, 26133, 3964, 340, 197, 197, 532, 197, 630, 2233, 795, 1669, 220, 21, 198, 2233, 1669, 609, 2972, 45791, 16094, 2233, 15753, 14535, 12485, 1900, 8850, 284, 526, 21, 19, 1883, 795, 340, 197, 322, 9043, 2477, 28252, 90619, 7388, 700, 315, 1973, 624, 41378, 596, 1669, 52931, 917, 2979, 1, 65, 18, 497, 330, 66, 17, 14345, 5212, 64, 497, 330, 65, 18, 95642, 2023, 8358, 9390, 1669, 2088, 44295, 341, 197, 2233, 54874, 66092, 58, 15, 1125, 9390, 58, 16, 2546, 197, 532, 743, 1848, 1669, 2927, 16708, 7502, 11, 293, 1215, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 197, 322, 3496, 32143, 3059, 369, 279, 1378, 7388, 624, 48558, 9801, 1669, 52931, 917, 515, 197, 197, 4913, 65, 18, 497, 330, 65, 19, 497, 330, 65, 20, 7115, 197, 197, 4913, 64, 16, 497, 330, 64, 17, 497, 330, 64, 18, 7115, 197, 532, 25157, 26570, 9801, 1155, 11, 44295, 11, 293, 62440, 11, 1343, 9801, 11, 2092, 1391, 19527, 36572, 1779, 3798, 90, 8516, 25, 52881, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestImportDirectPostWithAttachments(t *testing.T) { th := Setup(t) defer th.TearDown() testsDir, _ := fileutils.FindDir("tests") testImage := filepath.Join(testsDir, "test.png") testImage2 := filepath.Join(testsDir, "test.svg") // create a temp file with same name as original but with a different first byte tmpFolder, _ := ioutil.TempDir("", "imgFake") testImageFake := filepath.Join(tmpFolder, "test.png") fakeFileData, _ := ioutil.ReadFile(testImage) fakeFileData[0] = 0 _ = ioutil.WriteFile(testImageFake, fakeFileData, 0644) defer os.RemoveAll(tmpFolder) // Create a user. username := model.NewId() th.App.importUser(&UserImportData{ Username: &username, Email: ptrStr(model.NewId() + "@example.com"), }, false) user1, err := th.App.GetUserByUsername(username) require.Nil(t, err, "Failed to get user1 from database.") username2 := model.NewId() th.App.importUser(&UserImportData{ Username: &username2, Email: ptrStr(model.NewId() + "@example.com"), }, false) user2, err := th.App.GetUserByUsername(username2) require.Nil(t, err, "Failed to get user2 from database.") directImportData := &DirectPostImportData{ ChannelMembers: &[]string{ user1.Username, user2.Username, }, User: &user1.Username, Message: ptrStr("Direct message"), CreateAt: ptrInt64(model.GetMillis()), Attachments: &[]AttachmentImportData{{Path: &testImage}}, } t.Run("Regular import of attachment", func(t *testing.T) { err := th.App.importDirectPost(directImportData, false) require.Nil(t, err, "Expected success.") attachments := GetAttachments(user1.Id, th, t) assert.Len(t, attachments, 1) assert.Contains(t, attachments[0].Path, "noteam") AssertFileIdsInPost(attachments, th, t) }) t.Run("Attempt to import again with same file entirely, should NOT add an attachment", func(t *testing.T) { err := th.App.importDirectPost(directImportData, false) require.Nil(t, err, "Expected success.") attachments := GetAttachments(user1.Id, th, t) assert.Len(t, attachments, 1) }) t.Run("Attempt to import again with same name and size but different content, SHOULD add an attachment", func(t *testing.T) { directImportDataFake := &DirectPostImportData{ ChannelMembers: &[]string{ user1.Username, user2.Username, }, User: &user1.Username, Message: ptrStr("Direct message"), CreateAt: ptrInt64(model.GetMillis()), Attachments: &[]AttachmentImportData{{Path: &testImageFake}}, } err := th.App.importDirectPost(directImportDataFake, false) require.Nil(t, err, "Expected success.") attachments := GetAttachments(user1.Id, th, t) assert.Len(t, attachments, 2) }) t.Run("Attempt to import again with same data, SHOULD add an attachment, since it's different name", func(t *testing.T) { directImportData2 := &DirectPostImportData{ ChannelMembers: &[]string{ user1.Username, user2.Username, }, User: &user1.Username, Message: ptrStr("Direct message"), CreateAt: ptrInt64(model.GetMillis()), Attachments: &[]AttachmentImportData{{Path: &testImage2}}, } err := th.App.importDirectPost(directImportData2, false) require.Nil(t, err, "Expected success.") attachments := GetAttachments(user1.Id, th, t) assert.Len(t, attachments, 3) }) }
explode_data.jsonl/67146
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1247 }
[ 2830, 3393, 11511, 16027, 4133, 2354, 75740, 1155, 353, 8840, 836, 8, 1476, 70479, 1669, 18626, 1155, 340, 16867, 270, 836, 682, 4454, 2822, 78216, 6184, 11, 716, 1669, 1034, 6031, 9998, 6184, 445, 23841, 1138, 18185, 1906, 1669, 26054, 22363, 8623, 82, 6184, 11, 330, 1944, 3508, 1138, 18185, 1906, 17, 1669, 26054, 22363, 8623, 82, 6184, 11, 330, 1944, 15228, 1138, 197, 322, 1855, 264, 2730, 1034, 448, 1852, 829, 438, 4024, 714, 448, 264, 2155, 1156, 4922, 198, 20082, 13682, 11, 716, 1669, 43144, 65009, 6184, 19814, 330, 1892, 52317, 1138, 18185, 1906, 52317, 1669, 26054, 22363, 10368, 13682, 11, 330, 1944, 3508, 1138, 1166, 726, 1703, 1043, 11, 716, 1669, 43144, 78976, 8623, 1906, 340, 1166, 726, 1703, 1043, 58, 15, 60, 284, 220, 15, 198, 197, 62, 284, 43144, 4073, 1703, 8623, 1906, 52317, 11, 12418, 1703, 1043, 11, 220, 15, 21, 19, 19, 340, 16867, 2643, 84427, 10368, 13682, 692, 197, 322, 4230, 264, 1196, 624, 72358, 1669, 1614, 7121, 764, 741, 70479, 5105, 34897, 1474, 2099, 1474, 11511, 1043, 515, 197, 197, 11115, 25, 609, 5113, 345, 197, 197, 4781, 25, 262, 10087, 2580, 7635, 7121, 764, 368, 488, 8428, 8687, 905, 4461, 197, 2137, 895, 340, 19060, 16, 11, 1848, 1669, 270, 5105, 78179, 91519, 17084, 340, 17957, 59678, 1155, 11, 1848, 11, 330, 9408, 311, 633, 1196, 16, 504, 4625, 31225, 72358, 17, 1669, 1614, 7121, 764, 741, 70479, 5105, 34897, 1474, 2099, 1474, 11511, 1043, 515, 197, 197, 11115, 25, 609, 5113, 17, 345, 197, 197, 4781, 25, 262, 10087, 2580, 7635, 7121, 764, 368, 488, 8428, 8687, 905, 4461, 197, 2137, 895, 692, 19060, 17, 11, 1848, 1669, 270, 5105, 78179, 91519, 17084, 17, 340, 17957, 59678, 1155, 11, 1848, 11, 330, 9408, 311, 633, 1196, 17, 504, 4625, 31225, 2698, 1226, 11511, 1043, 1669, 609, 16027, 4133, 11511, 1043, 515, 197, 197, 9629, 24371, 25, 609, 1294, 917, 515, 298, 19060, 16, 42777, 345, 298, 19060, 17, 42777, 345, 197, 197, 1583, 197, 31672, 25, 286, 609, 872, 16, 42777, 345, 197, 46733, 25, 257, 10087, 2580, 445, 16027, 1943, 4461, 197, 75569, 1655, 25, 262, 10087, 1072, 21, 19, 7635, 2234, 17897, 14702, 197, 197, 75740, 25, 609, 1294, 33569, 11511, 1043, 2979, 1820, 25, 609, 1944, 1906, 22050, 197, 630, 3244, 16708, 445, 30404, 1159, 315, 19984, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 9859, 1669, 270, 5105, 34897, 16027, 4133, 1500, 1226, 11511, 1043, 11, 895, 340, 197, 17957, 59678, 1155, 11, 1848, 11, 330, 18896, 2393, 31225, 197, 197, 45878, 1669, 2126, 75740, 4277, 16, 6444, 11, 270, 11, 259, 340, 197, 6948, 65819, 1155, 11, 33679, 11, 220, 16, 340, 197, 6948, 11545, 1155, 11, 33679, 58, 15, 936, 1820, 11, 330, 9974, 309, 1138, 197, 18017, 1703, 12701, 641, 4133, 7, 45878, 11, 270, 11, 259, 340, 197, 8824, 3244, 16708, 445, 47052, 311, 1159, 1549, 448, 1852, 1034, 11368, 11, 1265, 4183, 912, 458, 19984, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 9859, 1669, 270, 5105, 34897, 16027, 4133, 1500, 1226, 11511, 1043, 11, 895, 340, 197, 17957, 59678, 1155, 11, 1848, 11, 330, 18896, 2393, 31225, 197, 197, 45878, 1669, 2126, 75740, 4277, 16, 6444, 11, 270, 11, 259, 340, 197, 6948, 65819, 1155, 11, 33679, 11, 220, 16, 340, 197, 8824, 3244, 16708, 445, 47052, 311, 1159, 1549, 448, 1852, 829, 323, 1379, 714, 2155, 2213, 11, 60875, 912, 458, 19984, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2698, 1226, 11511, 1043, 52317, 1669, 609, 16027, 4133, 11511, 1043, 515, 298, 197, 9629, 24371, 25, 609, 1294, 917, 515, 571, 19060, 16, 42777, 345, 571, 19060, 17, 42777, 345, 298, 197, 1583, 298, 31672, 25, 286, 609, 872, 16, 42777, 345, 298, 46733, 25, 257, 10087, 2580, 445, 16027, 1943, 4461, 298, 75569, 1655, 25, 262, 10087, 1072, 21, 19, 7635, 2234, 17897, 14702, 298, 197, 75740, 25, 609, 1294, 33569, 11511, 1043, 2979, 1820, 25, 609, 1944, 1906, 52317, 22050, 197, 197, 630, 197, 9859, 1669, 270, 5105, 34897, 16027, 4133, 1500, 1226, 11511, 1043, 52317, 11, 895, 340, 197, 17957, 59678, 1155, 11, 1848, 11, 330, 18896, 2393, 31225, 197, 197, 45878, 1669, 2126, 75740, 4277, 16, 6444, 11, 270, 11, 259, 340, 197, 6948, 65819, 1155, 11, 33679, 11, 220, 17, 340, 197, 8824, 3244, 16708, 445, 47052, 311, 1159, 1549, 448, 1852, 821, 11, 60875, 912, 458, 19984, 11, 2474, 432, 594, 2155, 829, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2698, 1226, 11511, 1043, 17, 1669, 609, 16027, 4133, 11511, 1043, 515, 298, 197, 9629, 24371, 25, 609, 1294, 917, 515, 571, 19060, 16, 42777, 345, 571, 19060, 17, 42777, 345, 298, 197, 1583, 298, 31672, 25, 286, 609, 872, 16, 42777, 345, 298, 46733, 25, 257, 10087, 2580, 445, 16027, 1943, 4461, 298, 75569, 1655, 25, 262, 10087, 1072, 21, 19, 7635, 2234, 17897, 14702, 298, 197, 75740, 25, 609, 1294, 33569, 11511, 1043, 2979, 1820, 25, 609, 1944, 1906, 17, 22050, 197, 197, 630, 197, 9859, 1669, 270, 5105, 34897, 16027, 4133, 1500, 1226, 11511, 1043, 17, 11, 895, 340, 197, 17957, 59678, 1155, 11, 1848, 11, 330, 18896, 2393, 31225, 197, 197, 45878, 1669, 2126, 75740, 4277, 16, 6444, 11, 270, 11, 259, 340, 197, 6948, 65819, 1155, 11, 33679, 11, 220, 18, 340, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestConnectorServiceQuerySuccess(t *testing.T) { // given var ( fixAppName = "app-name" fixURL = "http://some-url-with-token" fixGQLObj = &gqlschema.ConnectorService{ URL: "http://some-url-with-token", } ) serviceMock := automock.NewApplicationSvc() defer serviceMock.AssertExpectations(t) serviceMock.On("GetConnectionURL", fixAppName).Return(fixURL, nil) resolver := application.NewApplicationResolver(serviceMock, nil) // when gotURLObj, err := resolver.ConnectorServiceQuery(context.Background(), fixAppName) // then require.NoError(t, err) assert.Equal(t, fixGQLObj, gotURLObj) }
explode_data.jsonl/28765
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 230 }
[ 2830, 3393, 35954, 1860, 2859, 7188, 1155, 353, 8840, 836, 8, 341, 197, 322, 2661, 198, 2405, 2399, 197, 1166, 941, 87994, 284, 330, 676, 11494, 698, 197, 1166, 941, 3144, 257, 284, 330, 1254, 1110, 14689, 25443, 26189, 34841, 698, 197, 1166, 941, 38, 48, 1593, 35751, 220, 284, 609, 70, 1470, 17349, 50422, 1256, 1860, 515, 298, 79055, 25, 330, 1254, 1110, 14689, 25443, 26189, 34841, 756, 197, 197, 532, 197, 692, 52934, 11571, 1669, 5006, 1176, 7121, 4988, 92766, 741, 16867, 2473, 11571, 11711, 17536, 804, 1155, 340, 52934, 11571, 8071, 445, 1949, 4526, 3144, 497, 5046, 87994, 568, 5598, 955, 941, 3144, 11, 2092, 692, 10202, 7921, 1669, 3766, 7121, 4988, 18190, 21656, 11571, 11, 2092, 692, 197, 322, 979, 198, 3174, 354, 1511, 1593, 35751, 11, 1848, 1669, 36220, 50422, 1256, 1860, 2859, 5378, 19047, 1507, 5046, 87994, 692, 197, 322, 1221, 198, 17957, 35699, 1155, 11, 1848, 340, 6948, 12808, 1155, 11, 5046, 38, 48, 1593, 35751, 11, 2684, 1511, 1593, 35751, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUserDefinedBool(t *testing.T) { var flags FlagSet flags.Init("test", ContinueOnError) var b boolFlagVar var err error flags.Var(&b, "b", "usage") if err = flags.Parse([]string{"-b", "-b", "-b", "-b=true", "-b=false", "-b", "barg", "-b"}); err != nil { if b.count < 4 { t.Error(err) } } if b.count != 4 { t.Errorf("want: %d; got: %d", 4, b.count) } if err == nil { t.Error("expected error; got none") } }
explode_data.jsonl/53995
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 194 }
[ 2830, 3393, 1474, 29361, 11233, 1155, 353, 8840, 836, 8, 341, 2405, 8042, 22666, 1649, 198, 59516, 26849, 445, 1944, 497, 15003, 74945, 340, 2405, 293, 1807, 12135, 3962, 198, 2405, 1848, 1465, 198, 59516, 87968, 2099, 65, 11, 330, 65, 497, 330, 17698, 1138, 743, 1848, 284, 8042, 8937, 10556, 917, 4913, 12, 65, 497, 6523, 65, 497, 6523, 65, 497, 6523, 65, 11265, 497, 6523, 65, 12219, 497, 6523, 65, 497, 330, 65, 858, 497, 6523, 65, 9207, 1215, 1848, 961, 2092, 341, 197, 743, 293, 6501, 366, 220, 19, 341, 298, 3244, 6141, 3964, 340, 197, 197, 532, 197, 630, 743, 293, 6501, 961, 220, 19, 341, 197, 3244, 13080, 445, 52657, 25, 1018, 67, 26, 2684, 25, 1018, 67, 497, 220, 19, 11, 293, 6501, 340, 197, 630, 743, 1848, 621, 2092, 341, 197, 3244, 6141, 445, 7325, 1465, 26, 2684, 6857, 1138, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTenantPrefix(t *testing.T) { tIDs := []roachpb.TenantID{ roachpb.SystemTenantID, roachpb.MakeTenantID(2), roachpb.MakeTenantID(999), roachpb.MakeTenantID(math.MaxUint64), } for _, tID := range tIDs { t.Run(fmt.Sprintf("%v", tID), func(t *testing.T) { // Encode tenant ID. k := MakeTenantPrefix(tID) // The system tenant has no tenant prefix. if tID == roachpb.SystemTenantID { require.Len(t, k, 0) } // Encode table prefix. const tableID = 5 k = encoding.EncodeUvarintAscending(k, tableID) // Decode tenant ID. rem, retTID, err := DecodeTenantPrefix(k) require.Equal(t, tID, retTID) require.NoError(t, err) // Decode table prefix. rem, retTableID, err := encoding.DecodeUvarintAscending(rem) require.Len(t, rem, 0) require.Equal(t, uint64(tableID), retTableID) require.NoError(t, err) }) } }
explode_data.jsonl/56601
{ "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, 71252, 14335, 1155, 353, 8840, 836, 8, 341, 3244, 30466, 1669, 3056, 64500, 16650, 836, 25121, 915, 515, 197, 197, 64500, 16650, 16620, 71252, 915, 345, 197, 197, 64500, 16650, 50133, 71252, 915, 7, 17, 1326, 197, 197, 64500, 16650, 50133, 71252, 915, 7, 24, 24, 24, 1326, 197, 197, 64500, 16650, 50133, 71252, 915, 37270, 14535, 21570, 21, 19, 1326, 197, 532, 2023, 8358, 259, 915, 1669, 2088, 259, 30466, 341, 197, 3244, 16708, 28197, 17305, 4430, 85, 497, 259, 915, 701, 2915, 1155, 353, 8840, 836, 8, 341, 298, 197, 322, 56562, 25239, 3034, 624, 298, 16463, 1669, 7405, 71252, 14335, 1155, 915, 692, 298, 197, 322, 576, 1849, 25239, 702, 902, 25239, 9252, 624, 298, 743, 259, 915, 621, 926, 610, 16650, 16620, 71252, 915, 341, 571, 17957, 65819, 1155, 11, 595, 11, 220, 15, 340, 298, 197, 630, 298, 197, 322, 56562, 1965, 9252, 624, 298, 4777, 1965, 915, 284, 220, 20, 198, 298, 16463, 284, 11170, 50217, 52, 947, 396, 82952, 5969, 11, 1965, 915, 692, 298, 197, 322, 50194, 25239, 3034, 624, 298, 197, 1826, 11, 2112, 51, 915, 11, 1848, 1669, 50194, 71252, 14335, 5969, 340, 298, 17957, 12808, 1155, 11, 259, 915, 11, 2112, 51, 915, 340, 298, 17957, 35699, 1155, 11, 1848, 692, 298, 197, 322, 50194, 1965, 9252, 624, 298, 197, 1826, 11, 2112, 2556, 915, 11, 1848, 1669, 11170, 56372, 52, 947, 396, 82952, 7, 1826, 340, 298, 17957, 65819, 1155, 11, 1299, 11, 220, 15, 340, 298, 17957, 12808, 1155, 11, 2622, 21, 19, 15761, 915, 701, 2112, 2556, 915, 340, 298, 17957, 35699, 1155, 11, 1848, 340, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReminderExecutionZeroDuration(t *testing.T) { testActorsRuntime := newTestActorsRuntime() actorType, actorID := getTestActorTypeAndID() actorKey := testActorsRuntime.constructCompositeKey(actorType, actorID) fakeCallAndActivateActor(testActorsRuntime, actorKey) err := testActorsRuntime.executeReminder(actorType, actorID, "0ms", "0ms", "reminder0", "data") assert.Nil(t, err) }
explode_data.jsonl/60013
{ "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, 95359, 20294, 17999, 12945, 1155, 353, 8840, 836, 8, 341, 18185, 2414, 1087, 15123, 1669, 501, 2271, 2414, 1087, 15123, 741, 93410, 929, 11, 12089, 915, 1669, 633, 2271, 18870, 929, 3036, 915, 741, 93410, 1592, 1669, 1273, 2414, 1087, 15123, 84254, 41685, 1592, 65451, 929, 11, 12089, 915, 340, 1166, 726, 7220, 3036, 31242, 18870, 8623, 2414, 1087, 15123, 11, 12089, 1592, 692, 9859, 1669, 1273, 2414, 1087, 15123, 7769, 95359, 65451, 929, 11, 12089, 915, 11, 330, 15, 1011, 497, 330, 15, 1011, 497, 330, 77905, 15, 497, 330, 691, 1138, 6948, 59678, 1155, 11, 1848, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReadPlainBYTE_ARRAY(t *testing.T) { testData := [][]interface{}{ {("hello"), ("world")}, {("good"), (""), ("a"), ("b")}, } for _, data := range testData { res, _ := ReadPlainBYTE_ARRAY(bytes.NewReader(WritePlainBYTE_ARRAY(data)), uint64(len(data))) if fmt.Sprintf("%v", data) != fmt.Sprintf("%v", res) { t.Errorf("ReadPlainBYTE_ARRAY err, %v", data) } } }
explode_data.jsonl/23895
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 168 }
[ 2830, 3393, 4418, 26982, 33908, 17724, 1155, 353, 8840, 836, 8, 341, 18185, 1043, 1669, 52931, 4970, 67066, 197, 197, 90, 445, 14990, 3975, 3489, 14615, 79583, 197, 197, 90, 445, 18536, 3975, 320, 3014, 701, 3489, 64, 3975, 3489, 65, 79583, 197, 630, 2023, 8358, 821, 1669, 2088, 67348, 341, 197, 10202, 11, 716, 1669, 4457, 26982, 33908, 17724, 23158, 68587, 7, 7985, 26982, 33908, 17724, 2592, 5731, 2622, 21, 19, 6901, 2592, 5929, 197, 743, 8879, 17305, 4430, 85, 497, 821, 8, 961, 8879, 17305, 4430, 85, 497, 592, 8, 341, 298, 3244, 13080, 445, 4418, 26982, 33908, 17724, 1848, 11, 1018, 85, 497, 821, 340, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPackObjectReturnsObjectWithDeltaBaseOffset(t *testing.T) { const original = "Hello" compressed, _ := compress(original) delta, err := compress(string([]byte{ 0x05, // Source size: 5. 0x0e, // Destination size: 14. 0x91, // (1000 0001) (instruction=copy, bitmask=0001) 0x00, // (0000 0000) (offset=0) 0x05, // (0000 0101) (size=5) 0x09, // (0000 0111) (instruction=add, size=7) // Contents: ... ',', ' ', 'w', 'o', 'r', 'l', 'd', '!', '\n', })) p := &Packfile{ idx: IndexWith(map[string]uint32{ "cccccccccccccccccccccccccccccccccccccccc": uint32(32 + 1 + len(compressed)), }), r: bytes.NewReader(append(append([]byte{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x35, // (0011 0101) (msb=0, type=blob, size=5) }, compressed...), append([]byte{ 0x6e, // (0110 1010) (msb=0, type=obj_ofs_delta, size=10) 0x12, // (0001 0001) (ofs_delta=-17, len(compressed)) }, delta...)...)), } o, err := p.Object(DecodeHex(t, "cccccccccccccccccccccccccccccccccccccccc")) assert.NoError(t, err) assert.Equal(t, TypeBlob, o.Type()) unpacked, err := o.Unpack() assert.Equal(t, []byte(original+", world!\n"), unpacked) assert.NoError(t, err) }
explode_data.jsonl/30628
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 660 }
[ 2830, 3393, 30684, 1190, 16446, 1190, 2354, 20277, 3978, 6446, 1155, 353, 8840, 836, 8, 341, 4777, 4024, 284, 330, 9707, 698, 32810, 14318, 11, 716, 1669, 24611, 39809, 692, 85435, 11, 1848, 1669, 24611, 3609, 10556, 3782, 515, 197, 197, 15, 87, 15, 20, 11, 442, 8748, 1379, 25, 220, 20, 624, 197, 197, 15, 87, 15, 68, 11, 442, 41728, 1379, 25, 220, 16, 19, 382, 197, 197, 15, 87, 24, 16, 11, 442, 320, 16, 15, 15, 15, 220, 15, 15, 15, 16, 8, 320, 54974, 28, 8560, 11, 90961, 28, 15, 15, 15, 16, 340, 197, 197, 15, 87, 15, 15, 11, 442, 320, 15, 15, 15, 15, 220, 15, 15, 15, 15, 8, 320, 3176, 28, 15, 340, 197, 197, 15, 87, 15, 20, 11, 442, 320, 15, 15, 15, 15, 220, 15, 16, 15, 16, 8, 320, 2141, 28, 20, 692, 197, 197, 15, 87, 15, 24, 11, 442, 320, 15, 15, 15, 15, 220, 15, 16, 16, 16, 8, 320, 54974, 92784, 11, 1379, 28, 22, 692, 197, 197, 322, 35862, 25, 12236, 197, 197, 516, 516, 364, 6614, 364, 86, 516, 364, 78, 516, 364, 81, 516, 364, 75, 516, 364, 67, 516, 364, 38692, 5196, 77, 751, 197, 93596, 3223, 1669, 609, 30684, 1192, 515, 197, 62077, 25, 8008, 2354, 9147, 14032, 60, 2496, 18, 17, 515, 298, 197, 1, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 788, 2622, 18, 17, 7, 18, 17, 488, 220, 16, 488, 2422, 14094, 14318, 6965, 197, 197, 30793, 197, 7000, 25, 5820, 68587, 7, 5090, 7, 5090, 10556, 3782, 515, 298, 197, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 345, 298, 197, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 345, 298, 197, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 345, 298, 197, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 11, 220, 15, 87, 15, 3554, 298, 197, 15, 87, 18, 20, 11, 442, 320, 15, 15, 16, 16, 220, 15, 16, 15, 16, 8, 320, 1011, 65, 28, 15, 11, 943, 22086, 1684, 11, 1379, 28, 20, 340, 197, 197, 2137, 30649, 1112, 701, 8737, 10556, 3782, 515, 298, 197, 15, 87, 21, 68, 11, 442, 320, 15, 16, 16, 15, 220, 16, 15, 16, 15, 8, 320, 1011, 65, 28, 15, 11, 943, 77246, 3575, 82, 26710, 11, 1379, 28, 16, 15, 340, 298, 197, 15, 87, 16, 17, 11, 442, 320, 15, 15, 15, 16, 220, 15, 15, 15, 16, 8, 320, 36081, 26710, 10829, 16, 22, 11, 2422, 14094, 14318, 1171, 197, 197, 2137, 9477, 32574, 1112, 6965, 197, 630, 22229, 11, 1848, 1669, 281, 8348, 7, 32564, 20335, 1155, 11, 330, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 55597, 5455, 6948, 35699, 1155, 11, 1848, 692, 6948, 12808, 1155, 11, 3990, 37985, 11, 297, 10184, 12367, 20479, 50321, 11, 1848, 1669, 297, 10616, 4748, 741, 6948, 12808, 1155, 11, 3056, 3782, 39809, 44056, 1879, 14771, 77, 3975, 31065, 291, 340, 6948, 35699, 1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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetServiceKeyByName(t *testing.T) { Convey("Get service key by name", t, func() { setup(MockRoute{"GET", "/v2/service_keys", getServiceKeyPayload, "", 200, "q=name:test01_key", nil}, t) defer teardown() c := &Config{ ApiAddress: server.URL, Token: "foobar", } client, err := NewClient(c) So(err, ShouldBeNil) serviceKey, err := client.GetServiceKeyByName("test01_key") So(err, ShouldBeNil) So(serviceKey, ShouldNotBeNil) So(serviceKey.Name, ShouldEqual, "test01_key") So(serviceKey.ServiceInstanceGuid, ShouldEqual, "ecf26687-e176-4784-b181-b3c942fecb62") So(serviceKey.Credentials, ShouldNotEqual, nil) So(serviceKey.ServiceInstanceUrl, ShouldEqual, "/v2/service_instances/fcf26687-e176-4784-b181-b3c942fecb62") }) }
explode_data.jsonl/66019
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 328 }
[ 2830, 3393, 1949, 1860, 1592, 16898, 1155, 353, 8840, 836, 8, 341, 93070, 5617, 445, 1949, 2473, 1376, 553, 829, 497, 259, 11, 2915, 368, 341, 197, 84571, 66436, 4899, 4913, 3806, 497, 3521, 85, 17, 34186, 12631, 497, 85869, 1592, 29683, 11, 7342, 220, 17, 15, 15, 11, 330, 80, 39241, 84476, 15, 16, 3097, 497, 2092, 2137, 259, 340, 197, 16867, 49304, 741, 197, 1444, 1669, 609, 2648, 515, 298, 197, 6563, 4286, 25, 3538, 20893, 345, 298, 33299, 25, 414, 330, 50267, 756, 197, 197, 532, 197, 25291, 11, 1848, 1669, 1532, 2959, 1337, 340, 197, 76912, 3964, 11, 12260, 3430, 19064, 692, 197, 52934, 1592, 11, 1848, 1669, 2943, 81342, 1592, 16898, 445, 1944, 15, 16, 3097, 1138, 197, 76912, 3964, 11, 12260, 3430, 19064, 692, 197, 76912, 21656, 1592, 11, 12260, 2623, 3430, 19064, 340, 197, 76912, 21656, 1592, 2967, 11, 12260, 2993, 11, 330, 1944, 15, 16, 3097, 1138, 197, 76912, 21656, 1592, 13860, 2523, 16686, 11, 12260, 2993, 11, 330, 757, 69, 17, 21, 21, 23, 22, 5655, 16, 22, 21, 12, 19, 22, 23, 19, 1455, 16, 23, 16, 1455, 18, 66, 24, 19, 17, 76526, 65, 21, 17, 1138, 197, 76912, 21656, 1592, 727, 15735, 11, 12260, 2623, 2993, 11, 2092, 340, 197, 76912, 21656, 1592, 13860, 2523, 2864, 11, 12260, 2993, 11, 3521, 85, 17, 34186, 41504, 6663, 9792, 17, 21, 21, 23, 22, 5655, 16, 22, 21, 12, 19, 22, 23, 19, 1455, 16, 23, 16, 1455, 18, 66, 24, 19, 17, 76526, 65, 21, 17, 1138, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAPINewMultipartHandlerParallel(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPINewMultipartHandlerParallel, []string{"NewMultipart"}) }
explode_data.jsonl/10704
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 64 }
[ 2830, 3393, 2537, 687, 365, 44, 18204, 3050, 16547, 1155, 353, 8840, 836, 8, 341, 16867, 33287, 2271, 2304, 585, 1155, 8, 741, 197, 10216, 1190, 9188, 2537, 952, 477, 1155, 11, 1273, 2537, 687, 365, 44, 18204, 3050, 16547, 11, 3056, 917, 4913, 3564, 44, 18204, 23625, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestNSERetryClient_Unregister(t *testing.T) { t.Cleanup(func() { goleak.VerifyNone(t) }) var callCounter = &count.CallCounter{} var counter = count.NewNetworkServiceEndpointRegistryClient(callCounter) var client = chain.NewNetworkServiceEndpointRegistryClient( retry.NewNetworkServiceEndpointRegistryClient( context.Background(), retry.WithInterval(time.Millisecond*10), retry.WithTryTimeout(time.Second/30)), counter, injecterror.NewNetworkServiceEndpointRegistryClient(injecterror.WithUnregisterErrorTimes(0, 1, 2, 3, 4)), ) var _, err = client.Unregister(context.Background(), nil) require.NoError(t, err) require.Equal(t, 6, callCounter.Unregisters()) }
explode_data.jsonl/68614
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 238 }
[ 2830, 3393, 2448, 640, 15149, 2959, 40687, 6343, 1155, 353, 8840, 836, 8, 341, 3244, 727, 60639, 18552, 368, 314, 728, 273, 585, 54853, 4064, 1155, 8, 9568, 2405, 1618, 14099, 284, 609, 1830, 27017, 14099, 16094, 2405, 5546, 284, 1760, 7121, 12320, 1860, 27380, 15603, 2959, 32691, 14099, 692, 2405, 2943, 284, 8781, 7121, 12320, 1860, 27380, 15603, 2959, 1006, 197, 17200, 1539, 7121, 12320, 1860, 27380, 15603, 2959, 1006, 298, 28413, 19047, 3148, 298, 17200, 1539, 26124, 10256, 9730, 71482, 9, 16, 15, 1326, 298, 17200, 1539, 26124, 21453, 7636, 9730, 32435, 14, 18, 15, 6965, 197, 58261, 345, 197, 17430, 583, 841, 7121, 12320, 1860, 27380, 15603, 2959, 5900, 583, 841, 26124, 1806, 6343, 1454, 18889, 7, 15, 11, 220, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 6965, 197, 692, 2405, 8358, 1848, 284, 2943, 10616, 6343, 5378, 19047, 1507, 2092, 340, 17957, 35699, 1155, 11, 1848, 340, 17957, 12808, 1155, 11, 220, 21, 11, 1618, 14099, 10616, 76937, 2398, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestReadCRSpecFromEnvYaml(t *testing.T) { os.Setenv("YAML_CONF", "") _, err := ReadCRSpecFromEnvYaml() if err == nil { t.Fail() } setup(t) cfg, err := ReadCRSpecFromEnvYaml() if err != nil { t.Fatalf("error reading config from env") } if cfg.Spec.Configs["qliksense"][0].Name != "acceptEULA" { t.Fail() } if cfg.Spec.Configs["qliksense"][0].Value != "yes" { t.Fail() } }
explode_data.jsonl/60728
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 186 }
[ 2830, 3393, 4418, 8973, 8327, 3830, 14359, 56, 9467, 1155, 353, 8840, 836, 8, 341, 25078, 4202, 3160, 445, 56, 31102, 29212, 497, 14676, 197, 6878, 1848, 1669, 4457, 8973, 8327, 3830, 14359, 56, 9467, 741, 743, 1848, 621, 2092, 341, 197, 3244, 57243, 741, 197, 532, 84571, 1155, 340, 50286, 11, 1848, 1669, 4457, 8973, 8327, 3830, 14359, 56, 9467, 741, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 841, 5290, 2193, 504, 6105, 1138, 197, 532, 743, 13286, 36473, 10753, 82, 1183, 6905, 2787, 1117, 18121, 15, 936, 675, 961, 330, 10330, 36, 58069, 1, 341, 197, 3244, 57243, 741, 197, 532, 743, 13286, 36473, 10753, 82, 1183, 6905, 2787, 1117, 18121, 15, 936, 1130, 961, 330, 9693, 1, 341, 197, 3244, 57243, 741, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestTradeActions_SyntheticOfferIds(t *testing.T) { ht := StartHTTPTest(t, "offer_ids") defer ht.Finish() var records []horizon.Trade w := ht.Get("/trades") if ht.Assert.Equal(200, w.Code) { if ht.Assert.PageOf(4, w.Body) { ht.UnmarshalPage(w.Body, &records) assertOfferType(ht, records[0].BaseOfferID, TOIDType) assertOfferType(ht, records[1].BaseOfferID, TOIDType) assertOfferType(ht, records[2].BaseOfferID, CoreOfferIDType) assertOfferType(ht, records[3].BaseOfferID, CoreOfferIDType) } } }
explode_data.jsonl/6927
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 235 }
[ 2830, 3393, 39173, 12948, 1098, 1872, 17556, 39462, 12701, 1155, 353, 8840, 836, 8, 341, 197, 426, 1669, 5145, 9230, 2271, 1155, 11, 330, 25077, 8077, 1138, 16867, 34323, 991, 18176, 741, 2405, 7424, 3056, 19530, 16973, 8240, 1021, 198, 6692, 1669, 34323, 2234, 4283, 376, 3452, 1138, 743, 34323, 11711, 12808, 7, 17, 15, 15, 11, 289, 20274, 8, 341, 197, 743, 34323, 11711, 17558, 2124, 7, 19, 11, 289, 20934, 8, 341, 298, 197, 426, 38097, 2665, 3622, 20934, 11, 609, 26203, 340, 298, 6948, 39462, 929, 73392, 11, 7424, 58, 15, 936, 3978, 39462, 915, 11, 5146, 915, 929, 340, 298, 6948, 39462, 929, 73392, 11, 7424, 58, 16, 936, 3978, 39462, 915, 11, 5146, 915, 929, 340, 298, 6948, 39462, 929, 73392, 11, 7424, 58, 17, 936, 3978, 39462, 915, 11, 9518, 39462, 915, 929, 340, 298, 6948, 39462, 929, 73392, 11, 7424, 58, 18, 936, 3978, 39462, 915, 11, 9518, 39462, 915, 929, 340, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestFooterRoundTrip(t *testing.T) { buf := make([]byte, 100+maxFooterLen) for _, format := range []TableFormat{ TableFormatRocksDBv2, TableFormatLevelDB, } { t.Run(fmt.Sprintf("format=%d", format), func(t *testing.T) { checksums := []ChecksumType{ChecksumTypeCRC32c} if format != TableFormatLevelDB { checksums = []ChecksumType{ChecksumTypeCRC32c, ChecksumTypeXXHash64} } for _, checksum := range checksums { t.Run(fmt.Sprintf("checksum=%d", checksum), func(t *testing.T) { footer := footer{ format: format, checksum: checksum, metaindexBH: BlockHandle{Offset: 1, Length: 2}, indexBH: BlockHandle{Offset: 3, Length: 4}, } for _, offset := range []int64{0, 1, 100} { t.Run(fmt.Sprintf("offset=%d", offset), func(t *testing.T) { mem := vfs.NewMem() f, err := mem.Create("test") require.NoError(t, err) _, err = f.Write(buf[:offset]) require.NoError(t, err) encoded := footer.encode(buf[100:]) _, err = f.Write(encoded) require.NoError(t, err) require.NoError(t, f.Close()) footer.footerBH.Offset = uint64(offset) footer.footerBH.Length = uint64(len(encoded)) f, err = mem.Open("test") require.NoError(t, err) result, err := readFooter(f) require.NoError(t, err) require.NoError(t, f.Close()) if diff := pretty.Diff(footer, result); diff != nil { t.Fatalf("expected %+v, but found %+v\n%s", footer, result, strings.Join(diff, "\n")) } }) } }) } }) } }
explode_data.jsonl/40344
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 794 }
[ 2830, 3393, 19445, 27497, 56352, 1155, 353, 8840, 836, 8, 341, 26398, 1669, 1281, 10556, 3782, 11, 220, 16, 15, 15, 10, 2810, 19445, 11271, 340, 2023, 8358, 3561, 1669, 2088, 3056, 2556, 4061, 515, 197, 197, 2556, 4061, 49, 25183, 3506, 85, 17, 345, 197, 197, 2556, 4061, 4449, 3506, 345, 197, 92, 341, 197, 3244, 16708, 28197, 17305, 445, 2243, 7846, 67, 497, 3561, 701, 2915, 1155, 353, 8840, 836, 8, 341, 298, 25157, 1242, 82, 1669, 3056, 73190, 929, 90, 73190, 929, 83339, 18, 17, 66, 532, 298, 743, 3561, 961, 6633, 4061, 4449, 3506, 341, 571, 25157, 1242, 82, 284, 3056, 73190, 929, 90, 73190, 929, 83339, 18, 17, 66, 11, 4248, 1242, 929, 6148, 6370, 21, 19, 532, 298, 197, 532, 298, 2023, 8358, 32529, 1669, 2088, 32529, 82, 341, 571, 3244, 16708, 28197, 17305, 445, 70740, 7846, 67, 497, 32529, 701, 2915, 1155, 353, 8840, 836, 8, 341, 464, 197, 6956, 1669, 23173, 515, 1144, 59416, 25, 414, 3561, 345, 1144, 25157, 1242, 25, 262, 32529, 345, 1144, 2109, 295, 466, 91769, 97151, 25, 8362, 6999, 90, 6446, 25, 220, 16, 11, 17287, 25, 220, 17, 1583, 1144, 26327, 97151, 25, 257, 8362, 6999, 90, 6446, 25, 220, 18, 11, 17287, 25, 220, 19, 1583, 464, 197, 532, 464, 2023, 8358, 4347, 1669, 2088, 3056, 396, 21, 19, 90, 15, 11, 220, 16, 11, 220, 16, 15, 15, 92, 341, 1144, 3244, 16708, 28197, 17305, 445, 3176, 7846, 67, 497, 4347, 701, 2915, 1155, 353, 8840, 836, 8, 341, 1662, 14145, 1669, 92941, 7121, 18816, 741, 1662, 1166, 11, 1848, 1669, 1833, 7251, 445, 1944, 1138, 1662, 17957, 35699, 1155, 11, 1848, 692, 1662, 197, 6878, 1848, 284, 282, 4073, 10731, 3447, 3176, 2546, 1662, 17957, 35699, 1155, 11, 1848, 692, 1662, 197, 19329, 1669, 23173, 17313, 10731, 58, 16, 15, 15, 43057, 1662, 197, 6878, 1848, 284, 282, 4073, 76270, 340, 1662, 17957, 35699, 1155, 11, 1848, 340, 1662, 17957, 35699, 1155, 11, 282, 10421, 12367, 1662, 197, 6956, 58256, 97151, 61958, 284, 2622, 21, 19, 26245, 340, 1662, 197, 6956, 58256, 97151, 6833, 284, 2622, 21, 19, 6901, 76270, 4390, 1662, 1166, 11, 1848, 284, 1833, 12953, 445, 1944, 1138, 1662, 17957, 35699, 1155, 11, 1848, 692, 1662, 9559, 11, 1848, 1669, 1349, 19445, 955, 340, 1662, 17957, 35699, 1155, 11, 1848, 340, 1662, 17957, 35699, 1155, 11, 282, 10421, 12367, 1662, 743, 3638, 1669, 5020, 98063, 7, 6956, 11, 1102, 1215, 3638, 961, 2092, 341, 2683, 3244, 30762, 445, 7325, 68524, 85, 11, 714, 1730, 68524, 85, 1699, 12952, 756, 2187, 197, 6956, 11, 1102, 11, 9069, 22363, 37124, 11, 2917, 77, 5455, 1662, 197, 532, 1144, 197, 3518, 464, 197, 532, 571, 197, 3518, 298, 197, 532, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestWorkdir(t *testing.T) { b := &Builder{flags: &BFlags{}, runConfig: &container.Config{}, disableCommit: true} workingDir := "/app" if runtime.GOOS == "windows" { workingDir = "C:\app" } err := workdir(b, []string{workingDir}, nil, "") if err != nil { t.Fatalf("Error should be empty, got: %s", err.Error()) } if b.runConfig.WorkingDir != workingDir { t.Fatalf("WorkingDir should be set to %s, got %s", workingDir, b.runConfig.WorkingDir) } }
explode_data.jsonl/28279
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 178 }
[ 2830, 3393, 6776, 3741, 1155, 353, 8840, 836, 8, 341, 2233, 1669, 609, 3297, 90, 11161, 25, 609, 33, 9195, 22655, 1598, 2648, 25, 609, 3586, 10753, 22655, 11156, 33441, 25, 830, 630, 197, 21152, 6184, 1669, 3521, 676, 1837, 743, 15592, 97574, 3126, 621, 330, 27077, 1, 341, 197, 197, 21152, 6184, 284, 330, 34, 7190, 676, 698, 197, 630, 9859, 1669, 975, 3741, 1883, 11, 3056, 917, 90, 21152, 6184, 2137, 2092, 11, 85617, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 1454, 1265, 387, 4287, 11, 2684, 25, 1018, 82, 497, 1848, 6141, 2398, 197, 630, 743, 293, 7634, 2648, 28748, 287, 6184, 961, 3238, 6184, 341, 197, 3244, 30762, 445, 33978, 6184, 1265, 387, 738, 311, 1018, 82, 11, 2684, 1018, 82, 497, 3238, 6184, 11, 293, 7634, 2648, 28748, 287, 6184, 340, 197, 630, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCrossShardPoolv2RemoveBlockByHeight(t *testing.T) { ResetCrossShardPoolTest() removeSinceBlockHeight := make(map[byte]uint64) fromShardID := byte(0) toShardID := byte(1) removeSinceBlockHeight[fromShardID] = 4 crossShardPoolMapTest[toShardID].validPool[fromShardID] = append(crossShardPoolMapTest[toShardID].validPool[fromShardID], crossShardBlock2) crossShardPoolMapTest[toShardID].validPool[fromShardID] = append(crossShardPoolMapTest[toShardID].validPool[fromShardID], crossShardBlock5) crossShardPoolMapTest[toShardID].pendingPool[fromShardID] = append(crossShardPoolMapTest[toShardID].pendingPool[fromShardID], crossShardBlock3) crossShardPoolMapTest[toShardID].pendingPool[fromShardID] = append(crossShardPoolMapTest[toShardID].pendingPool[fromShardID], crossShardBlock6) if len(crossShardPoolMapTest[toShardID].pendingPool[fromShardID]) != 2 { t.Fatalf("expect pending pool has two block but get %+v", len(crossShardPoolMapTest[toShardID].pendingPool[fromShardID])) } if len(crossShardPoolMapTest[toShardID].validPool[fromShardID]) != 2 { t.Fatalf("expect valid pool has two block but get %+v", len(crossShardPoolMapTest[toShardID].validPool[fromShardID])) } crossShardPoolMapTest[toShardID].removeBlockByHeight(removeSinceBlockHeight) if len(crossShardPoolMapTest[toShardID].pendingPool[fromShardID]) != 1 { t.Fatalf("expect pending pool has two block but get %+v", len(crossShardPoolMapTest[toShardID].pendingPool[fromShardID])) } if len(crossShardPoolMapTest[toShardID].validPool[fromShardID]) != 1 { t.Fatalf("expect valid pool has two block but get %+v", len(crossShardPoolMapTest[toShardID].validPool[fromShardID])) } if crossShardPoolMapTest[toShardID].pendingPool[fromShardID][0].Header.Height != 6 { t.Fatalf("expect pending pool has block 6 but get %+v", crossShardPoolMapTest[toShardID].pendingPool[fromShardID][0].Header.Height) } if crossShardPoolMapTest[toShardID].validPool[fromShardID][0].Header.Height != 5 { t.Fatalf("expect valid pool has block 5 but get %+v", crossShardPoolMapTest[toShardID].validPool[fromShardID][0].Header.Height) } }
explode_data.jsonl/74592
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 784 }
[ 2830, 3393, 28501, 2016, 567, 10551, 85, 17, 13021, 4713, 1359, 3640, 1155, 353, 8840, 836, 8, 341, 197, 14828, 28501, 2016, 567, 10551, 2271, 741, 47233, 12549, 4713, 3640, 1669, 1281, 9147, 58, 3782, 60, 2496, 21, 19, 340, 42727, 2016, 567, 915, 1669, 4922, 7, 15, 340, 31709, 2016, 567, 915, 1669, 4922, 7, 16, 340, 47233, 12549, 4713, 3640, 78330, 2016, 567, 915, 60, 284, 220, 19, 198, 1444, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 60, 284, 8737, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 1125, 5312, 2016, 567, 4713, 17, 340, 1444, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 60, 284, 8737, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 1125, 5312, 2016, 567, 4713, 20, 340, 1444, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 60, 284, 8737, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 1125, 5312, 2016, 567, 4713, 18, 340, 1444, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 60, 284, 8737, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 1125, 5312, 2016, 567, 4713, 21, 340, 743, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 2467, 961, 220, 17, 341, 197, 3244, 30762, 445, 17119, 15280, 7314, 702, 1378, 2504, 714, 633, 68524, 85, 497, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 10907, 197, 532, 743, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 2467, 961, 220, 17, 341, 197, 3244, 30762, 445, 17119, 2697, 7314, 702, 1378, 2504, 714, 633, 68524, 85, 497, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 10907, 197, 532, 1444, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 5399, 4713, 1359, 3640, 67709, 12549, 4713, 3640, 340, 743, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 2467, 961, 220, 16, 341, 197, 3244, 30762, 445, 17119, 15280, 7314, 702, 1378, 2504, 714, 633, 68524, 85, 497, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 10907, 197, 532, 743, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 2467, 961, 220, 16, 341, 197, 3244, 30762, 445, 17119, 2697, 7314, 702, 1378, 2504, 714, 633, 68524, 85, 497, 2422, 1337, 2128, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 10907, 197, 532, 743, 5312, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 1457, 15, 936, 4047, 17743, 961, 220, 21, 341, 197, 3244, 30762, 445, 17119, 15280, 7314, 702, 2504, 220, 21, 714, 633, 68524, 85, 497, 5312, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 28210, 10551, 78330, 2016, 567, 915, 1457, 15, 936, 4047, 17743, 340, 197, 532, 743, 5312, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 1457, 15, 936, 4047, 17743, 961, 220, 20, 341, 197, 3244, 30762, 445, 17119, 2697, 7314, 702, 2504, 220, 20, 714, 633, 68524, 85, 497, 5312, 2016, 567, 10551, 2227, 2271, 66299, 2016, 567, 915, 936, 1891, 10551, 78330, 2016, 567, 915, 1457, 15, 936, 4047, 17743, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
7
func TestShouldHashSHA512Password(t *testing.T) { hash, err := HashPassword("password", "aFr56HjK3DrB8t3S", HashingAlgorithmSHA512, 50000, 0, 0, 0, 16) assert.NoError(t, err) code, parameters, salt, hash, _ := crypt.DecodeSettings(hash) assert.Equal(t, "6", code) assert.Equal(t, "aFr56HjK3DrB8t3S", salt) assert.Equal(t, "zhPQiS85cgBlNhUKKE6n/AHMlpqrvYSnSL3fEVkK0yHFQ.oFFAd8D4OhPAy18K5U61Z2eBhxQXExGU/eknXlY1", hash) assert.Equal(t, schema.DefaultPasswordSHA512Configuration.Iterations, parameters.GetInt("rounds", HashingDefaultSHA512Iterations)) }
explode_data.jsonl/40164
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 247 }
[ 2830, 3393, 14996, 6370, 33145, 20, 16, 17, 4876, 1155, 353, 8840, 836, 8, 341, 50333, 11, 1848, 1669, 6531, 4876, 445, 3833, 497, 330, 64, 22560, 20, 21, 39, 73, 42, 18, 8847, 33, 23, 83, 18, 50, 497, 6531, 287, 27847, 33145, 20, 16, 17, 11, 220, 20, 15, 15, 15, 15, 11, 220, 15, 11, 220, 15, 11, 220, 15, 11, 220, 16, 21, 692, 6948, 35699, 1155, 11, 1848, 692, 43343, 11, 5029, 11, 12021, 11, 5175, 11, 716, 1669, 14436, 56372, 6086, 27580, 692, 6948, 12808, 1155, 11, 330, 21, 497, 2038, 340, 6948, 12808, 1155, 11, 330, 64, 22560, 20, 21, 39, 73, 42, 18, 8847, 33, 23, 83, 18, 50, 497, 12021, 340, 6948, 12808, 1155, 11, 330, 23815, 47, 96175, 50, 23, 20, 27446, 4923, 79759, 24537, 3390, 21, 77, 10360, 52148, 13545, 80, 10553, 9394, 77, 7984, 18, 69, 46010, 74, 42, 15, 88, 49716, 48, 14439, 1748, 2589, 23, 35, 19, 11908, 8041, 88, 16, 23, 42, 20, 52, 21, 16, 57, 17, 68, 33, 58424, 48, 55, 840, 54695, 14, 1225, 77, 55, 75, 56, 16, 497, 5175, 340, 6948, 12808, 1155, 11, 10802, 13275, 4876, 33145, 20, 16, 17, 7688, 36238, 804, 11, 5029, 43148, 445, 1049, 82, 497, 6531, 287, 3675, 33145, 20, 16, 17, 67789, 1171, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAdditionalCIDR(t *testing.T) { runTestAWS(t, "additionalcidr.example.com", "additional_cidr", "v1alpha3", false, 3, true, false, nil) runTestCloudformation(t, "additionalcidr.example.com", "additional_cidr", "v1alpha2", false, nil) }
explode_data.jsonl/17506
{ "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, 29019, 54146, 49, 1155, 353, 8840, 836, 8, 341, 56742, 2271, 36136, 1155, 11, 330, 35499, 20558, 81, 7724, 905, 497, 330, 35499, 68699, 81, 497, 330, 85, 16, 7141, 18, 497, 895, 11, 220, 18, 11, 830, 11, 895, 11, 2092, 340, 56742, 2271, 16055, 1627, 1155, 11, 330, 35499, 20558, 81, 7724, 905, 497, 330, 35499, 68699, 81, 497, 330, 85, 16, 7141, 17, 497, 895, 11, 2092, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_StrStrMap_Batch(t *testing.T) { gtest.C(t, func(t *gtest.T) { m := gmap.NewStrStrMap() m.Sets(map[string]string{"a": "a", "b": "b", "c": "c"}) t.Assert(m.Map(), map[string]string{"a": "a", "b": "b", "c": "c"}) m.Removes([]string{"a", "b"}) t.Assert(m.Map(), map[string]string{"c": "c"}) }) }
explode_data.jsonl/36007
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 163 }
[ 2830, 3393, 46171, 2580, 2227, 1668, 754, 1155, 353, 8840, 836, 8, 341, 3174, 1944, 727, 1155, 11, 2915, 1155, 353, 82038, 836, 8, 341, 197, 2109, 1669, 342, 2186, 7121, 2580, 2580, 2227, 2822, 197, 2109, 808, 1415, 9147, 14032, 30953, 4913, 64, 788, 330, 64, 497, 330, 65, 788, 330, 65, 497, 330, 66, 788, 330, 66, 23625, 197, 3244, 11711, 1255, 10104, 1507, 2415, 14032, 30953, 4913, 64, 788, 330, 64, 497, 330, 65, 788, 330, 65, 497, 330, 66, 788, 330, 66, 23625, 197, 2109, 11398, 10088, 10556, 917, 4913, 64, 497, 330, 65, 23625, 197, 3244, 11711, 1255, 10104, 1507, 2415, 14032, 30953, 4913, 66, 788, 330, 66, 23625, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestIssue20575(t *testing.T) { db := newTestDB(t, "people") defer closeDB(t, db) tx, err := db.Begin() if err != nil { t.Fatal(err) } ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() _, err = tx.QueryContext(ctx, "SELECT|people|age,name|") if err != nil { t.Fatal(err) } // Do not close Rows from QueryContext. err = tx.Rollback() if err != nil { t.Fatal(err) } select { default: case <-ctx.Done(): t.Fatal("timeout: failed to rollback query without closing rows:", ctx.Err()) } }
explode_data.jsonl/16018
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 225 }
[ 2830, 3393, 42006, 17, 15, 20, 22, 20, 1155, 353, 8840, 836, 8, 341, 20939, 1669, 501, 2271, 3506, 1155, 11, 330, 16069, 1138, 16867, 3265, 3506, 1155, 11, 2927, 692, 46237, 11, 1848, 1669, 2927, 28467, 741, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 20985, 11, 9121, 1669, 2266, 26124, 7636, 5378, 19047, 1507, 220, 18, 77053, 32435, 340, 16867, 9121, 741, 197, 6878, 1848, 284, 9854, 15685, 1972, 7502, 11, 330, 4858, 91, 16069, 91, 424, 22006, 91, 1138, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 197, 322, 3155, 537, 3265, 61706, 504, 11361, 1972, 624, 9859, 284, 9854, 88918, 741, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 38010, 341, 11940, 510, 2722, 9119, 3773, 60422, 3932, 197, 3244, 26133, 445, 14150, 25, 4641, 311, 60414, 3239, 2041, 15316, 6978, 12147, 5635, 27862, 2398, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestRuleOrderByMultiDirection(t *testing.T) { common.Log.Debug("Entering function: %s", common.GetFunctionName()) sqls := [][]string{ { `SELECT col FROM tbl order by col desc, col2 asc`, }, { `SELECT col FROM tbl order by col, col2`, }, } for _, sql := range sqls[0] { q, err := NewQuery4Audit(sql) if err == nil { rule := q.RuleOrderByMultiDirection() if rule.Item != "KEY.008" { t.Error("Rule not match:", rule.Item, "Expect : KEY.008") } } else { t.Error("sqlparser.Parse Error:", err) } } for _, sql := range sqls[1] { q, err := NewQuery4Audit(sql) if err == nil { rule := q.RuleOrderByMultiDirection() if rule.Item != "OK" { t.Error("Rule not match:", rule.Item, "Expect : OK") } } else { t.Error("sqlparser.Parse Error:", err) } } common.Log.Debug("Exiting function: %s", common.GetFunctionName()) }
explode_data.jsonl/76831
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 379 }
[ 2830, 3393, 11337, 34605, 20358, 9268, 1155, 353, 8840, 836, 8, 341, 83825, 5247, 20345, 445, 82867, 729, 25, 1018, 82, 497, 4185, 2234, 5152, 675, 2398, 30633, 82, 1669, 52931, 917, 515, 197, 197, 515, 298, 197, 63, 4858, 1375, 4295, 21173, 1973, 553, 1375, 6560, 11, 1375, 17, 14601, 12892, 197, 197, 1583, 197, 197, 515, 298, 197, 63, 4858, 1375, 4295, 21173, 1973, 553, 1375, 11, 1375, 17, 12892, 197, 197, 1583, 197, 532, 2023, 8358, 5704, 1669, 2088, 5704, 82, 58, 15, 60, 341, 197, 18534, 11, 1848, 1669, 1532, 2859, 19, 74516, 13148, 340, 197, 743, 1848, 621, 2092, 341, 298, 7000, 1111, 1669, 2804, 63961, 34605, 20358, 9268, 741, 298, 743, 5912, 9399, 961, 330, 4784, 13, 15, 15, 23, 1, 341, 571, 3244, 6141, 445, 11337, 537, 2432, 12147, 5912, 9399, 11, 330, 17536, 549, 12013, 13, 15, 15, 23, 1138, 298, 197, 532, 197, 197, 92, 770, 341, 298, 3244, 6141, 445, 3544, 9657, 8937, 4600, 12147, 1848, 340, 197, 197, 532, 197, 630, 2023, 8358, 5704, 1669, 2088, 5704, 82, 58, 16, 60, 341, 197, 18534, 11, 1848, 1669, 1532, 2859, 19, 74516, 13148, 340, 197, 743, 1848, 621, 2092, 341, 298, 7000, 1111, 1669, 2804, 63961, 34605, 20358, 9268, 741, 298, 743, 5912, 9399, 961, 330, 3925, 1, 341, 571, 3244, 6141, 445, 11337, 537, 2432, 12147, 5912, 9399, 11, 330, 17536, 549, 10402, 1138, 298, 197, 532, 197, 197, 92, 770, 341, 298, 3244, 6141, 445, 3544, 9657, 8937, 4600, 12147, 1848, 340, 197, 197, 532, 197, 630, 83825, 5247, 20345, 445, 87924, 729, 25, 1018, 82, 497, 4185, 2234, 5152, 675, 2398, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
7
func TestStepper_Before(t *testing.T) { st := Stepper{ N: 1, U: Unum, } val, err := st.Before(2) assert.NoError(t, err) assert.Equal(t, 1, val) }
explode_data.jsonl/78068
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 77 }
[ 2830, 3393, 20903, 6922, 1668, 4642, 1155, 353, 8840, 836, 8, 341, 18388, 1669, 3360, 6922, 515, 197, 18317, 25, 220, 16, 345, 197, 15980, 25, 1230, 372, 345, 197, 532, 19302, 11, 1848, 1669, 357, 31153, 7, 17, 340, 6948, 35699, 1155, 11, 1848, 340, 6948, 12808, 1155, 11, 220, 16, 11, 1044, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDelimiterRegexRegex(t *testing.T) { delim := delimiterRegexp("--\\*") tokens := Tokenize("-*--*---**---", delim) if delim.str != nil || tokens[0].text.ToString() != "-*--*" || tokens[1].text.ToString() != "---*" || tokens[2].text.ToString() != "*---" { t.Errorf("%s %d", tokens, len(tokens)) } }
explode_data.jsonl/40863
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 147 }
[ 2830, 3393, 91098, 32464, 32464, 1155, 353, 8840, 836, 8, 341, 2698, 39795, 1669, 29020, 3477, 4580, 21549, 3422, 9, 1138, 3244, 9713, 1669, 9660, 551, 13645, 9, 313, 9, 4421, 334, 4421, 497, 63209, 340, 743, 63209, 9528, 961, 2092, 8244, 197, 3244, 9713, 58, 15, 936, 1318, 5418, 368, 961, 6523, 9, 313, 64110, 8244, 197, 3244, 9713, 58, 16, 936, 1318, 5418, 368, 961, 75894, 64110, 8244, 197, 3244, 9713, 58, 17, 936, 1318, 5418, 368, 961, 15630, 4421, 1, 341, 197, 3244, 13080, 4430, 82, 1018, 67, 497, 11211, 11, 2422, 34052, 1171, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGocloak_LoginAdmin(t *testing.T) { t.Parallel() cfg := GetConfig(t) client := NewClientWithDebug(t) _, err := client.LoginAdmin( cfg.Admin.UserName, cfg.Admin.Password, cfg.Admin.Realm) FailIfErr(t, err, "LoginAdmin failed") }
explode_data.jsonl/79520
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 102 }
[ 2830, 3393, 38, 509, 385, 585, 79232, 7210, 1155, 353, 8840, 836, 8, 341, 3244, 41288, 7957, 741, 50286, 1669, 2126, 2648, 1155, 340, 25291, 1669, 1532, 2959, 2354, 7939, 1155, 340, 197, 6878, 1848, 1669, 2943, 32499, 7210, 1006, 197, 50286, 39469, 43672, 345, 197, 50286, 39469, 25690, 345, 197, 50286, 39469, 2817, 7673, 340, 12727, 604, 2679, 7747, 1155, 11, 1848, 11, 330, 6231, 7210, 4641, 1138, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_Service_Echo(t *testing.T) { bkoff := backoff.NewExponentialBackOff() bkoff.MaxElapsedTime = time.Second * 15 err := backoff.Retry(func() error { logger, _ := test.NewNullLogger() logger.SetLevel(logrus.DebugLevel) c := service.NewContainer(logger) c.Register(ID, &Service{}) err := c.Init(&testCfg{httpCfg: `{ "enable": true, "address": ":6536", "maxRequestSize": 1024, "uploads": { "dir": ` + tmpDir() + `, "forbid": [] }, "workers":{ "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, "allocateTimeout": 10000000, "destroyTimeout": 10000000 } } }`}) if err != nil { return err } s, st := c.Get(ID) assert.NotNil(t, s) assert.Equal(t, service.StatusOK, st) // should do nothing s.(*Service).Stop() go func() { err := c.Serve() if err != nil { t.Errorf("serve error: %v", err) } }() time.Sleep(time.Millisecond * 100) req, err := http.NewRequest("GET", "http://localhost:6536?hello=world", nil) if err != nil { c.Stop() return err } r, err := http.DefaultClient.Do(req) if err != nil { c.Stop() return err } b, err := ioutil.ReadAll(r.Body) if err != nil { c.Stop() return err } assert.Equal(t, 201, r.StatusCode) assert.Equal(t, "WORLD", string(b)) err = r.Body.Close() if err != nil { c.Stop() return err } c.Stop() return nil }, bkoff) if err != nil { t.Fatal(err) } }
explode_data.jsonl/34498
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 718 }
[ 2830, 3393, 52548, 2089, 958, 1155, 353, 8840, 836, 8, 341, 2233, 74, 1847, 1669, 1182, 1847, 7121, 840, 59825, 3707, 4596, 741, 2233, 74, 1847, 14535, 98483, 284, 882, 32435, 353, 220, 16, 20, 271, 9859, 1669, 1182, 1847, 2013, 15149, 18552, 368, 1465, 341, 197, 17060, 11, 716, 1669, 1273, 7121, 3280, 7395, 741, 197, 17060, 4202, 4449, 12531, 20341, 20345, 4449, 692, 197, 1444, 1669, 2473, 7121, 4502, 37833, 340, 197, 1444, 19983, 18742, 11, 609, 1860, 6257, 692, 197, 9859, 1669, 272, 26849, 2099, 1944, 42467, 90, 1254, 42467, 25, 1565, 515, 298, 197, 1, 12552, 788, 830, 345, 298, 197, 1, 4995, 788, 13022, 21, 20, 18, 21, 756, 298, 197, 1, 2810, 1900, 1695, 788, 220, 16, 15, 17, 19, 345, 298, 197, 1, 19374, 788, 341, 571, 197, 1, 3741, 788, 1565, 488, 4174, 6184, 368, 488, 63545, 571, 197, 1, 1958, 20648, 788, 4167, 298, 197, 1583, 298, 197, 1, 54958, 12602, 571, 197, 1, 5631, 788, 330, 1208, 63579, 23841, 15627, 25085, 2296, 1687, 31175, 756, 571, 197, 1, 90891, 788, 330, 86720, 756, 571, 197, 1, 10285, 788, 341, 464, 197, 1, 2413, 74486, 788, 220, 16, 11, 715, 464, 197, 1, 31191, 7636, 788, 220, 16, 15, 15, 15, 15, 15, 15, 15, 345, 464, 197, 1, 15518, 7636, 788, 220, 16, 15, 15, 15, 15, 15, 15, 15, 715, 571, 197, 532, 298, 197, 532, 197, 5541, 3518, 197, 743, 1848, 961, 2092, 341, 298, 853, 1848, 198, 197, 197, 630, 197, 1903, 11, 357, 1669, 272, 2234, 18742, 340, 197, 6948, 93882, 1155, 11, 274, 340, 197, 6948, 12808, 1155, 11, 2473, 52989, 11, 357, 692, 197, 197, 322, 1265, 653, 4302, 198, 197, 1903, 41399, 1860, 568, 10674, 2822, 197, 30680, 2915, 368, 341, 298, 9859, 1669, 272, 83535, 741, 298, 743, 1848, 961, 2092, 341, 571, 3244, 13080, 445, 13267, 1465, 25, 1018, 85, 497, 1848, 340, 298, 197, 532, 197, 197, 66816, 197, 21957, 31586, 9730, 71482, 353, 220, 16, 15, 15, 692, 197, 24395, 11, 1848, 1669, 1758, 75274, 445, 3806, 497, 330, 1254, 1110, 8301, 25, 21, 20, 18, 21, 30, 14990, 28, 14615, 497, 2092, 340, 197, 743, 1848, 961, 2092, 341, 298, 1444, 30213, 741, 298, 853, 1848, 198, 197, 197, 630, 197, 7000, 11, 1848, 1669, 1758, 13275, 2959, 33596, 6881, 340, 197, 743, 1848, 961, 2092, 341, 298, 1444, 30213, 741, 298, 853, 1848, 198, 197, 197, 532, 197, 2233, 11, 1848, 1669, 43144, 41851, 2601, 20934, 340, 197, 743, 1848, 961, 2092, 341, 298, 1444, 30213, 741, 298, 853, 1848, 198, 197, 197, 532, 197, 6948, 12808, 1155, 11, 220, 17, 15, 16, 11, 435, 37828, 340, 197, 6948, 12808, 1155, 11, 330, 54, 24956, 497, 914, 1883, 4390, 197, 9859, 284, 435, 20934, 10421, 741, 197, 743, 1848, 961, 2092, 341, 298, 1444, 30213, 741, 298, 853, 1848, 198, 197, 197, 630, 197, 1444, 30213, 741, 197, 853, 2092, 198, 197, 2137, 66101, 1847, 692, 743, 1848, 961, 2092, 341, 197, 3244, 26133, 3964, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestSyncConfig(t *testing.T) { var testcases = []struct { name string oldRes []common.Resource newRes []common.Resource expect []common.Resource }{ { name: "empty", oldRes: []common.Resource{}, newRes: []common.Resource{}, expect: []common.Resource{}, }, { name: "append", oldRes: []common.Resource{}, newRes: []common.Resource{ { Name: "res", Type: "t", }, }, expect: []common.Resource{ { Name: "res", Type: "t", State: "free", }, }, }, { name: "should not have a type change", oldRes: []common.Resource{ { Name: "res", Type: "t", }, }, newRes: []common.Resource{ { Name: "res", Type: "d", }, }, expect: []common.Resource{ { Name: "res", Type: "t", }, }, }, { name: "delete", oldRes: []common.Resource{ { Name: "res", Type: "t", }, }, newRes: []common.Resource{}, expect: []common.Resource{}, }, { name: "delete busy", oldRes: []common.Resource{ { Name: "res", Type: "t", State: "busy", Owner: "o", }, }, newRes: []common.Resource{}, expect: []common.Resource{ { Name: "res", Type: "t", State: "busy", Owner: "o", }, }, }, { name: "append and delete", oldRes: []common.Resource{ { Name: "res-1", Type: "t", }, }, newRes: []common.Resource{ { Name: "res-2", Type: "t", }, }, expect: []common.Resource{ { Name: "res-2", Type: "t", State: "free", }, }, }, { name: "append and delete busy", oldRes: []common.Resource{ { Name: "res-1", Type: "t", State: "busy", Owner: "o", }, }, newRes: []common.Resource{ { Name: "res-2", Type: "t", }, }, expect: []common.Resource{ { Name: "res-1", Type: "t", State: "busy", Owner: "o", }, { Name: "res-2", Type: "t", State: "free", }, }, }, { name: "append/delete mixed type", oldRes: []common.Resource{ { Name: "res-1", Type: "t", }, }, newRes: []common.Resource{ { Name: "res-2", Type: "t", }, { Name: "res-3", Type: "t2", }, }, expect: []common.Resource{ { Name: "res-2", Type: "t", State: "free", }, { Name: "res-3", Type: "t2", State: "free", }, }, }, } for _, tc := range testcases { c := MakeTestRanch(tc.oldRes) c.syncConfigHelper(tc.newRes) if !reflect.DeepEqual(c.Resources, tc.expect) { t.Errorf("Test %v: got %v, expect %v", tc.name, c.Resources, tc.expect) } } }
explode_data.jsonl/12951
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 1571 }
[ 2830, 3393, 12154, 2648, 1155, 353, 8840, 836, 8, 341, 2405, 1273, 23910, 284, 3056, 1235, 341, 197, 11609, 256, 914, 198, 197, 61828, 1061, 3056, 5464, 20766, 198, 197, 8638, 1061, 3056, 5464, 20766, 198, 197, 24952, 3056, 5464, 20766, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 256, 330, 3194, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 38837, 298, 8638, 1061, 25, 3056, 5464, 20766, 38837, 298, 24952, 25, 3056, 5464, 20766, 38837, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 256, 330, 5090, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 38837, 298, 8638, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 10593, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 5445, 537, 614, 264, 943, 2297, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 756, 464, 27725, 25, 330, 67, 756, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 4542, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 38837, 298, 24952, 25, 3056, 5464, 20766, 38837, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 4542, 13028, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 78467, 756, 464, 197, 13801, 25, 330, 78, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 38837, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 78467, 756, 464, 197, 13801, 25, 330, 78, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 5090, 323, 3698, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 16, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 17, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 17, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 10593, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 5090, 323, 3698, 13028, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 16, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 78467, 756, 464, 197, 13801, 25, 330, 78, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 17, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 16, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 78467, 756, 464, 197, 13801, 25, 330, 78, 756, 571, 197, 1583, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 17, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 10593, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 5090, 32275, 9519, 943, 756, 298, 61828, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 16, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 298, 197, 1583, 298, 8638, 1061, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 17, 756, 464, 27725, 25, 330, 83, 756, 571, 197, 1583, 571, 197, 515, 464, 21297, 25, 330, 416, 12, 18, 756, 464, 27725, 25, 330, 83, 17, 756, 571, 197, 1583, 298, 197, 1583, 298, 24952, 25, 3056, 5464, 20766, 515, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 17, 756, 464, 27725, 25, 220, 330, 83, 756, 464, 76424, 25, 330, 10593, 756, 571, 197, 1583, 571, 197, 515, 464, 21297, 25, 220, 330, 416, 12, 18, 756, 464, 27725, 25, 220, 330, 83, 17, 756, 464, 76424, 25, 330, 10593, 756, 571, 197, 1583, 298, 197, 1583, 197, 197, 1583, 197, 630, 2023, 8358, 17130, 1669, 2088, 1273, 23910, 341, 197, 1444, 1669, 7405, 2271, 49, 3497, 44415, 46061, 1061, 340, 197, 1444, 30712, 2648, 5511, 44415, 4618, 1061, 340, 197, 743, 753, 34913, 94750, 1337, 21703, 11, 17130, 25952, 8, 341, 298, 3244, 13080, 445, 2271, 1018, 85, 25, 2684, 1018, 85, 11, 1720, 1018, 85, 497, 17130, 2644, 11, 272, 21703, 11, 17130, 25952, 340, 197, 197, 532, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDecode(t *testing.T) { t.Run("int", func(t *testing.T) { var x int err := conf.DecodeValues([]string{"10"}, conf.IntType, &x) assert.NoError(t, err) assert.Equal(t, 10, x) err = conf.DecodeValues([]string{"10m"}, conf.DurationType, &x) assert.NoError(t, err) assert.Equal(t, int(time.Minute*10), x) }) t.Run("float", func(t *testing.T) { var x float64 err := conf.DecodeValues([]string{"10.2"}, conf.FloatType, &x) assert.NoError(t, err) assert.Equal(t, 10.2, x) }) t.Run("bool", func(t *testing.T) { var x bool err := conf.DecodeValues([]string{"yes"}, conf.BoolType, &x) assert.NoError(t, err) assert.Equal(t, true, x) }) t.Run("interface", func(t *testing.T) { var x interface{} err := conf.DecodeValues([]string{"yes"}, conf.BoolType, &x) assert.NoError(t, err) assert.Equal(t, true, x) x = nil err = conf.DecodeValues([]string{"100"}, conf.IntType, &x) assert.NoError(t, err) assert.Equal(t, 100, x) x = nil err = conf.DecodeValues([]string{"1.0", "2.1", "3.2"}, conf.FloatSliceType, &x) assert.NoError(t, err) assert.Equal(t, []float64{1.0, 2.1, 3.2}, x) x = nil err = conf.DecodeValues([]string{"10m5s"}, conf.DurationType, &x) assert.NoError(t, err) assert.Equal(t, time.Minute*10+time.Second*5, x) }) }
explode_data.jsonl/20303
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 595 }
[ 2830, 3393, 32564, 1155, 353, 8840, 836, 8, 341, 3244, 16708, 445, 396, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2405, 856, 526, 271, 197, 9859, 1669, 2335, 56372, 6227, 10556, 917, 4913, 16, 15, 14345, 2335, 7371, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 220, 16, 15, 11, 856, 692, 197, 9859, 284, 2335, 56372, 6227, 10556, 917, 4913, 16, 15, 76, 14345, 2335, 33795, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 526, 9730, 75770, 9, 16, 15, 701, 856, 340, 197, 8824, 3244, 16708, 445, 3649, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2405, 856, 2224, 21, 19, 271, 197, 9859, 1669, 2335, 56372, 6227, 10556, 917, 4913, 16, 15, 13, 17, 14345, 2335, 29794, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 220, 16, 15, 13, 17, 11, 856, 340, 197, 8824, 3244, 16708, 445, 2641, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2405, 856, 1807, 271, 197, 9859, 1669, 2335, 56372, 6227, 10556, 917, 4913, 9693, 14345, 2335, 52497, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 830, 11, 856, 340, 197, 8824, 3244, 16708, 445, 4970, 497, 2915, 1155, 353, 8840, 836, 8, 341, 197, 2405, 856, 3749, 31483, 197, 9859, 1669, 2335, 56372, 6227, 10556, 917, 4913, 9693, 14345, 2335, 52497, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 830, 11, 856, 692, 197, 10225, 284, 2092, 198, 197, 9859, 284, 2335, 56372, 6227, 10556, 917, 4913, 16, 15, 15, 14345, 2335, 7371, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 220, 16, 15, 15, 11, 856, 692, 197, 10225, 284, 2092, 198, 197, 9859, 284, 2335, 56372, 6227, 10556, 917, 4913, 16, 13, 15, 497, 330, 17, 13, 16, 497, 330, 18, 13, 17, 14345, 2335, 29794, 33236, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 3056, 3649, 21, 19, 90, 16, 13, 15, 11, 220, 17, 13, 16, 11, 220, 18, 13, 17, 2137, 856, 692, 197, 10225, 284, 2092, 198, 197, 9859, 284, 2335, 56372, 6227, 10556, 917, 4913, 16, 15, 76, 20, 82, 14345, 2335, 33795, 929, 11, 609, 87, 340, 197, 6948, 35699, 1155, 11, 1848, 340, 197, 6948, 12808, 1155, 11, 882, 75770, 9, 16, 15, 10, 1678, 32435, 9, 20, 11, 856, 340, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 1, 1, 1, 1, 1, 1, 1, 1, 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 TestUpdateUserHashedPassword(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() client := th.Client password := "SuperSecurePass23!" passwordHash := "$2a$10$CiS1iWVPUj7rQNdY6XW53.DmaPLsETIvmW2p0asp4Dqpofs10UL5W" th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) { _, err := client.UpdateUserHashedPassword(th.BasicUser.Id, passwordHash) require.NoError(t, err) }) _, _, err := client.Login(th.BasicUser.Email, password) require.NoError(t, err) // Standard users should never be updating their passwords with already- // hashed passwords. resp, err := client.UpdateUserHashedPassword(th.BasicUser.Id, passwordHash) require.Error(t, err) CheckUnauthorizedStatus(t, resp) }
explode_data.jsonl/47528
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 278 }
[ 2830, 3393, 4289, 1474, 6370, 291, 4876, 1155, 353, 8840, 836, 8, 341, 70479, 1669, 18626, 1155, 568, 3803, 15944, 741, 16867, 270, 836, 682, 4454, 741, 25291, 1669, 270, 11716, 271, 58199, 1669, 330, 19284, 49813, 12187, 17, 18, 24734, 58199, 6370, 1669, 5201, 17, 64, 3, 16, 15, 3, 60619, 50, 16, 72, 54, 53, 6325, 73, 22, 81, 48, 39837, 56, 21, 55, 54, 20, 18, 909, 1728, 2916, 82, 1348, 40, 7338, 54, 17, 79, 15, 13367, 19, 35, 32763, 36081, 16, 15, 1094, 20, 54, 698, 70479, 8787, 2461, 2320, 7210, 3036, 7319, 1155, 11, 2915, 1155, 353, 8840, 836, 11, 2943, 353, 2528, 11716, 19, 8, 341, 197, 197, 6878, 1848, 1669, 2943, 16689, 1474, 6370, 291, 4876, 24365, 48868, 1474, 6444, 11, 3552, 6370, 340, 197, 17957, 35699, 1155, 11, 1848, 340, 197, 8824, 197, 6878, 8358, 1848, 1669, 2943, 32499, 24365, 48868, 1474, 24066, 11, 3552, 340, 17957, 35699, 1155, 11, 1848, 692, 197, 322, 11766, 3847, 1265, 2581, 387, 21010, 862, 33716, 448, 2669, 6913, 197, 322, 50676, 33716, 624, 34653, 11, 1848, 1669, 2943, 16689, 1474, 6370, 291, 4876, 24365, 48868, 1474, 6444, 11, 3552, 6370, 340, 17957, 6141, 1155, 11, 1848, 340, 69472, 51181, 2522, 1155, 11, 9039, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestExtractCustomQueryParams(t *testing.T) { testcases := []struct { name string config *mysql.Config expectedParams map[string]string expectedCustomParams map[string]string expectedErr error }{ {name: "nil config", expectedErr: ErrNilConfig}, { name: "no params", config: mysql.NewConfig(), expectedCustomParams: map[string]string{}, }, { name: "no custom params", config: &mysql.Config{Params: map[string]string{"hello": "world"}}, expectedParams: map[string]string{"hello": "world"}, expectedCustomParams: map[string]string{}, }, { name: "one param, one custom param", config: &mysql.Config{ Params: map[string]string{"hello": "world", "x-foo": "bar"}, }, expectedParams: map[string]string{"hello": "world"}, expectedCustomParams: map[string]string{"x-foo": "bar"}, }, { name: "multiple params, multiple custom params", config: &mysql.Config{ Params: map[string]string{ "hello": "world", "x-foo": "bar", "dead": "beef", "x-cat": "hat", }, }, expectedParams: map[string]string{"hello": "world", "dead": "beef"}, expectedCustomParams: map[string]string{"x-foo": "bar", "x-cat": "hat"}, }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { customParams, err := extractCustomQueryParams(tc.config) if tc.config != nil { assert.Equal(t, tc.expectedParams, tc.config.Params, "Expected config params have custom params properly removed") } assert.Equal(t, tc.expectedErr, err, "Expected errors to match") assert.Equal(t, tc.expectedCustomParams, customParams, "Expected custom params to be properly extracted") }) } }
explode_data.jsonl/47866
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 799 }
[ 2830, 3393, 28959, 10268, 2859, 4870, 1155, 353, 8840, 836, 8, 341, 18185, 23910, 1669, 3056, 1235, 341, 197, 11609, 338, 914, 198, 197, 25873, 2290, 353, 12272, 10753, 198, 197, 42400, 4870, 981, 2415, 14032, 30953, 198, 197, 42400, 10268, 4870, 2415, 14032, 30953, 198, 197, 42400, 7747, 688, 1465, 198, 197, 59403, 197, 197, 47006, 25, 330, 8385, 2193, 497, 3601, 7747, 25, 15495, 19064, 2648, 1583, 197, 197, 515, 298, 11609, 25, 338, 330, 2152, 3628, 756, 298, 25873, 25, 2290, 10564, 7121, 2648, 3148, 298, 42400, 10268, 4870, 25, 2415, 14032, 30953, 38837, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 338, 330, 2152, 2526, 3628, 756, 298, 25873, 25, 2290, 609, 12272, 10753, 90, 4870, 25, 2415, 14032, 30953, 4913, 14990, 788, 330, 14615, 48085, 298, 42400, 4870, 25, 981, 2415, 14032, 30953, 4913, 14990, 788, 330, 14615, 7115, 298, 42400, 10268, 4870, 25, 2415, 14032, 30953, 38837, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 603, 1685, 11, 825, 2526, 1685, 756, 298, 25873, 25, 609, 12272, 10753, 515, 571, 197, 4870, 25, 2415, 14032, 30953, 4913, 14990, 788, 330, 14615, 497, 330, 87, 12, 7975, 788, 330, 2257, 7115, 298, 197, 1583, 298, 42400, 4870, 25, 981, 2415, 14032, 30953, 4913, 14990, 788, 330, 14615, 7115, 298, 42400, 10268, 4870, 25, 2415, 14032, 30953, 4913, 87, 12, 7975, 788, 330, 2257, 7115, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 35673, 3628, 11, 5248, 2526, 3628, 756, 298, 25873, 25, 609, 12272, 10753, 515, 571, 197, 4870, 25, 2415, 14032, 30953, 515, 464, 197, 1, 14990, 788, 330, 14615, 756, 464, 197, 65438, 12, 7975, 788, 330, 2257, 756, 464, 197, 1, 33754, 788, 220, 330, 1371, 823, 756, 464, 197, 65438, 83892, 788, 330, 9198, 756, 571, 197, 1583, 298, 197, 1583, 298, 42400, 4870, 25, 981, 2415, 14032, 30953, 4913, 14990, 788, 330, 14615, 497, 330, 33754, 788, 330, 1371, 823, 7115, 298, 42400, 10268, 4870, 25, 2415, 14032, 30953, 4913, 87, 12, 7975, 788, 330, 2257, 497, 330, 87, 83892, 788, 330, 9198, 7115, 197, 197, 1583, 197, 532, 2023, 8358, 17130, 1669, 2088, 1273, 23910, 341, 197, 3244, 16708, 44415, 2644, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 1444, 1450, 4870, 11, 1848, 1669, 8649, 10268, 2859, 4870, 44415, 5423, 340, 298, 743, 17130, 5423, 961, 2092, 341, 571, 6948, 12808, 1155, 11, 17130, 56835, 4870, 11, 17130, 5423, 58268, 345, 464, 197, 1, 18896, 2193, 3628, 614, 2526, 3628, 10277, 6963, 1138, 298, 197, 532, 298, 6948, 12808, 1155, 11, 17130, 56835, 7747, 11, 1848, 11, 330, 18896, 5975, 311, 2432, 1138, 298, 6948, 12808, 1155, 11, 17130, 56835, 10268, 4870, 11, 2526, 4870, 345, 571, 197, 1, 18896, 2526, 3628, 311, 387, 10277, 27432, 1138, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestLdFlagsFullTemplate(t *testing.T) { run := time.Now().UTC() commit := time.Now().AddDate(-1, 0, 0) ctx := &context.Context{ Git: context.GitInfo{ CurrentTag: "v1.2.3", Commit: "123", CommitDate: commit, }, Date: run, Version: "1.2.3", Env: map[string]string{"FOO": "123"}, } artifact := &artifact.Artifact{Goarch: "amd64"} flags, err := tmpl.New(ctx).WithArtifact(artifact, map[string]string{}). Apply(`-s -w -X main.version={{.Version}} -X main.tag={{.Tag}} -X main.date={{.Date}} -X main.commit={{.Commit}} -X "main.foo={{.Env.FOO}}" -X main.time={{ time "20060102" }} -X main.arch={{.Arch}} -X main.commitDate={{.CommitDate}}`) require.NoError(t, err) require.Contains(t, flags, "-s -w") require.Contains(t, flags, "-X main.version=1.2.3") require.Contains(t, flags, "-X main.tag=v1.2.3") require.Contains(t, flags, "-X main.commit=123") require.Contains(t, flags, fmt.Sprintf("-X main.date=%d", run.Year())) require.Contains(t, flags, fmt.Sprintf("-X main.time=%d", run.Year())) require.Contains(t, flags, `-X "main.foo=123"`) require.Contains(t, flags, `-X main.arch=amd64`) require.Contains(t, flags, fmt.Sprintf("-X main.commitDate=%d", commit.Year())) }
explode_data.jsonl/54153
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 538 }
[ 2830, 3393, 43, 67, 9195, 9432, 7275, 1155, 353, 8840, 836, 8, 341, 56742, 1669, 882, 13244, 1005, 21183, 741, 197, 17413, 1669, 882, 13244, 1005, 2212, 1916, 4080, 16, 11, 220, 15, 11, 220, 15, 692, 20985, 1669, 609, 2147, 9328, 515, 197, 9600, 275, 25, 2266, 1224, 275, 1731, 515, 298, 197, 5405, 5668, 25, 330, 85, 16, 13, 17, 13, 18, 756, 298, 197, 33441, 25, 257, 330, 16, 17, 18, 756, 298, 197, 33441, 1916, 25, 5266, 345, 197, 197, 1583, 197, 48730, 25, 262, 1598, 345, 197, 77847, 25, 330, 16, 13, 17, 13, 18, 756, 197, 197, 14359, 25, 257, 2415, 14032, 30953, 4913, 3788, 46, 788, 330, 16, 17, 18, 7115, 197, 532, 197, 63722, 1669, 609, 63722, 50064, 20754, 90, 10850, 1113, 25, 330, 67913, 21, 19, 16707, 59516, 11, 1848, 1669, 79839, 7121, 7502, 568, 2354, 85578, 7, 63722, 11, 2415, 14032, 30953, 6257, 4292, 197, 197, 28497, 5809, 12, 82, 481, 86, 481, 55, 1887, 19484, 6780, 13, 5637, 3417, 481, 55, 1887, 12399, 6780, 13, 5668, 3417, 481, 55, 1887, 9907, 6780, 13, 1916, 3417, 481, 55, 1887, 15728, 6780, 13, 33441, 3417, 481, 55, 330, 3817, 58432, 6780, 13, 14359, 991, 19499, 23386, 481, 55, 1887, 6378, 6780, 882, 330, 17, 15, 15, 21, 15, 16, 15, 17, 1, 3869, 481, 55, 1887, 38091, 6780, 13, 18727, 3417, 481, 55, 1887, 15728, 1916, 6780, 13, 33441, 1916, 3417, 24183, 17957, 35699, 1155, 11, 1848, 340, 17957, 11545, 1155, 11, 8042, 11, 6523, 82, 481, 86, 1138, 17957, 11545, 1155, 11, 8042, 11, 6523, 55, 1887, 19484, 28, 16, 13, 17, 13, 18, 1138, 17957, 11545, 1155, 11, 8042, 11, 6523, 55, 1887, 12399, 39254, 16, 13, 17, 13, 18, 1138, 17957, 11545, 1155, 11, 8042, 11, 6523, 55, 1887, 15728, 28, 16, 17, 18, 1138, 17957, 11545, 1155, 11, 8042, 11, 8879, 17305, 13645, 55, 1887, 9907, 7846, 67, 497, 1598, 43629, 12145, 17957, 11545, 1155, 11, 8042, 11, 8879, 17305, 13645, 55, 1887, 6378, 7846, 67, 497, 1598, 43629, 12145, 17957, 11545, 1155, 11, 8042, 11, 93797, 55, 330, 3817, 58432, 28, 16, 17, 18, 1, 24183, 17957, 11545, 1155, 11, 8042, 11, 93797, 55, 1887, 38091, 28, 67913, 21, 19, 24183, 17957, 11545, 1155, 11, 8042, 11, 8879, 17305, 13645, 55, 1887, 15728, 1916, 7846, 67, 497, 5266, 43629, 12145, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestInputService10ProtocolTestBlobAndTimestampShapesCase1(t *testing.T) { sess := session.New() svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService10TestShapeInputService10TestCaseOperation1Input{ StructureParam: &InputService10TestShapeStructureShape{ B: []byte("foo"), T: aws.Time(time.Unix(1422172800, 0)), }, } req, _ := svc.InputService10TestCaseOperation1Request(input) r := req.HTTPRequest // build request restxml.Build(req) assert.NoError(t, req.Error) // assert body assert.NotNil(t, r.Body) body := util.SortXML(r.Body) awstesting.AssertXML(t, `<OperationRequest xmlns="https://foo/"><StructureParam xmlns="https://foo/"><b xmlns="https://foo/">Zm9v</b><t xmlns="https://foo/">2015-01-25T08:00:00Z</t></StructureParam></OperationRequest>`, util.Trim(string(body)), InputService10TestShapeInputService10TestCaseOperation1Input{}) // assert URL awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) // assert headers }
explode_data.jsonl/46480
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 387 }
[ 2830, 3393, 2505, 1860, 16, 15, 20689, 2271, 37985, 3036, 20812, 92193, 4207, 16, 1155, 353, 8840, 836, 8, 341, 1903, 433, 1669, 3797, 7121, 741, 1903, 7362, 1669, 1532, 2505, 1860, 16, 15, 20689, 2271, 57223, 11, 609, 8635, 10753, 90, 27380, 25, 31521, 6431, 445, 2428, 1110, 1944, 899, 3518, 22427, 1669, 609, 2505, 1860, 16, 15, 2271, 12301, 2505, 1860, 16, 15, 16458, 8432, 16, 2505, 515, 197, 197, 22952, 2001, 25, 609, 2505, 1860, 16, 15, 2271, 12301, 22952, 12301, 515, 298, 12791, 25, 3056, 3782, 445, 7975, 4461, 298, 10261, 25, 31521, 16299, 9730, 10616, 941, 7, 16, 19, 17, 17, 16, 22, 17, 23, 15, 15, 11, 220, 15, 6965, 197, 197, 1583, 197, 532, 24395, 11, 716, 1669, 46154, 16130, 1860, 16, 15, 16458, 8432, 16, 1900, 5384, 340, 7000, 1669, 4232, 27358, 1900, 271, 197, 322, 1936, 1681, 198, 197, 3927, 6455, 25212, 6881, 340, 6948, 35699, 1155, 11, 4232, 6141, 692, 197, 322, 2060, 2487, 198, 6948, 93882, 1155, 11, 435, 20934, 340, 35402, 1669, 4094, 35976, 10609, 2601, 20934, 340, 197, 672, 267, 59855, 11711, 10609, 1155, 11, 30586, 8432, 1900, 24967, 428, 2428, 1110, 7975, 14, 3088, 22952, 2001, 24967, 428, 2428, 1110, 7975, 14, 3088, 65, 24967, 428, 2428, 1110, 7975, 38681, 57, 76, 24, 85, 522, 65, 1784, 83, 24967, 428, 2428, 1110, 7975, 38681, 17, 15, 16, 20, 12, 15, 16, 12, 17, 20, 51, 15, 23, 25, 15, 15, 25, 15, 15, 57, 522, 83, 1472, 22952, 2001, 1472, 8432, 1900, 29, 7808, 4094, 18815, 3609, 15225, 5731, 5571, 1860, 16, 15, 2271, 12301, 2505, 1860, 16, 15, 16458, 8432, 16, 2505, 6257, 692, 197, 322, 2060, 5548, 198, 197, 672, 267, 59855, 11711, 3144, 1155, 11, 330, 2428, 1110, 1944, 14, 17, 15, 16, 19, 12, 15, 16, 12, 15, 16, 90119, 291, 8684, 497, 435, 20893, 6431, 12367, 197, 322, 2060, 7102, 271, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestDeltaDecode(t *testing.T) { t.Skipf("TODO: investigate this test failure") for _, test := range []struct { name string input []byte want []uint32 }{ { name: "small", input: []byte{0x03, 0x43, 0x01, 0x00, 0x04, 0x06, 0x42, 0x27, 0x08}, want: []uint32{3, 4, 5, 6, 9, 10, 15, 17, 18, 333}, }, } { t.Run(test.name, func(t *testing.T) { buffer := make([]uint32, len(test.want), len(test.want)+32) num := turbopfor.P4nd1dec32(test.input, buffer) if got, want := num, len(test.input); got != want { t.Fatalf("got %d, want %d", got, want) } if !reflect.DeepEqual(buffer, test.want) { t.Fatalf("got %v, want %v", buffer, test.want) } }) } }
explode_data.jsonl/42860
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 335 }
[ 2830, 3393, 20277, 32564, 1155, 353, 8840, 836, 8, 341, 3244, 57776, 69, 445, 14732, 25, 19314, 419, 1273, 7901, 1138, 2023, 8358, 1273, 1669, 2088, 3056, 1235, 341, 197, 11609, 220, 914, 198, 197, 22427, 3056, 3782, 198, 197, 50780, 220, 3056, 2496, 18, 17, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 220, 330, 9004, 756, 298, 22427, 25, 3056, 3782, 90, 15, 87, 15, 18, 11, 220, 15, 87, 19, 18, 11, 220, 15, 87, 15, 16, 11, 220, 15, 87, 15, 15, 11, 220, 15, 87, 15, 19, 11, 220, 15, 87, 15, 21, 11, 220, 15, 87, 19, 17, 11, 220, 15, 87, 17, 22, 11, 220, 15, 87, 15, 23, 1583, 298, 50780, 25, 220, 3056, 2496, 18, 17, 90, 18, 11, 220, 19, 11, 220, 20, 11, 220, 21, 11, 220, 24, 11, 220, 16, 15, 11, 220, 16, 20, 11, 220, 16, 22, 11, 220, 16, 23, 11, 220, 18, 18, 18, 1583, 197, 197, 1583, 197, 92, 341, 197, 3244, 16708, 8623, 2644, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 31122, 1669, 1281, 10556, 2496, 18, 17, 11, 2422, 8623, 70212, 701, 2422, 8623, 70212, 7257, 18, 17, 340, 298, 22431, 1669, 28012, 453, 1958, 1069, 19, 303, 16, 8169, 18, 17, 8623, 10046, 11, 4147, 340, 298, 743, 2684, 11, 1366, 1669, 1629, 11, 2422, 8623, 10046, 1215, 2684, 961, 1366, 341, 571, 3244, 30762, 445, 22390, 1018, 67, 11, 1366, 1018, 67, 497, 2684, 11, 1366, 340, 298, 197, 532, 298, 743, 753, 34913, 94750, 12584, 11, 1273, 70212, 8, 341, 571, 3244, 30762, 445, 22390, 1018, 85, 11, 1366, 1018, 85, 497, 4147, 11, 1273, 70212, 340, 298, 197, 532, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAccAWSS3BucketObject_defaultBucketSSE(t *testing.T) { var obj1 s3.GetObjectOutput resourceName := "aws_s3_bucket_object.object" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ { Config: testAccAWSS3BucketObjectConfig_defaultBucketSSE(rInt, "stuff"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSS3BucketObjectExists(resourceName, &obj1), testAccCheckAWSS3BucketObjectBody(&obj1, "stuff"), ), }, }, }) }
explode_data.jsonl/64975
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 261 }
[ 2830, 3393, 14603, 14419, 1220, 18, 36018, 1190, 9993, 36018, 50, 925, 1155, 353, 8840, 836, 8, 341, 2405, 2839, 16, 274, 18, 25618, 5097, 198, 50346, 675, 1669, 330, 8635, 643, 18, 38749, 5314, 6035, 698, 7000, 1072, 1669, 1613, 67880, 2013, 437, 1072, 2822, 50346, 41288, 7957, 2271, 1155, 11, 5101, 31363, 515, 197, 197, 4703, 3973, 25, 257, 2915, 368, 314, 1273, 14603, 4703, 3973, 1155, 8, 1153, 197, 197, 37351, 25, 262, 1273, 14603, 37351, 345, 197, 69472, 14245, 25, 1273, 14603, 3973, 14419, 1220, 18, 36018, 1190, 14245, 345, 197, 197, 33951, 25, 3056, 9233, 8787, 8304, 515, 298, 197, 515, 571, 66156, 25, 1273, 14603, 14419, 1220, 18, 36018, 1190, 2648, 9993, 36018, 50, 925, 2601, 1072, 11, 330, 57304, 4461, 571, 69472, 25, 5101, 85860, 2271, 3973, 9626, 1006, 464, 18185, 14603, 3973, 14419, 1220, 18, 36018, 1190, 15575, 71077, 11, 609, 2295, 16, 1326, 464, 18185, 14603, 3973, 14419, 1220, 18, 36018, 1190, 5444, 2099, 2295, 16, 11, 330, 57304, 4461, 571, 197, 1326, 298, 197, 1583, 197, 197, 1583, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetSpecificIndexer(t *testing.T) { p := mock.TVIndexer{} indexersCollection = []Indexer{p} if _, err := GetIndexer("Unknown"); err == nil { t.Error("Expected to have error when getting unknown indexer, got none") } if _, err := GetIndexer("TVIndexer"); err != nil { t.Errorf("Got error while retrieving known indexer: %s", err.Error()) } }
explode_data.jsonl/81820
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 125 }
[ 2830, 3393, 1949, 47514, 1552, 261, 1155, 353, 8840, 836, 8, 341, 3223, 1669, 7860, 836, 53, 1552, 261, 16094, 26327, 388, 6482, 284, 3056, 1552, 261, 90, 79, 630, 743, 8358, 1848, 1669, 2126, 1552, 261, 445, 13790, 5038, 1848, 621, 2092, 341, 197, 3244, 6141, 445, 18896, 311, 614, 1465, 979, 3709, 9788, 87216, 11, 2684, 6857, 1138, 197, 630, 743, 8358, 1848, 1669, 2126, 1552, 261, 445, 15653, 1552, 261, 5038, 1848, 961, 2092, 341, 197, 3244, 13080, 445, 32462, 1465, 1393, 48224, 3881, 87216, 25, 1018, 82, 497, 1848, 6141, 2398, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPopulateCluster_IsolateMasters(t *testing.T) { c := buildMinimalCluster() c.Spec.IsolateMasters = fi.Bool(true) cloud, err := BuildCloud(c) if err != nil { t.Fatalf("error from BuildCloud: %v", err) } err = PerformAssignments(c, cloud) if err != nil { t.Fatalf("error from PerformAssignments: %v", err) } full, err := mockedPopulateClusterSpec(c) if err != nil { t.Fatalf("Unexpected error from PopulateCluster: %v", err) } if fi.BoolValue(full.Spec.MasterKubelet.EnableDebuggingHandlers) != false { t.Fatalf("Unexpected EnableDebuggingHandlers: %v", fi.BoolValue(full.Spec.MasterKubelet.EnableDebuggingHandlers)) } if fi.BoolValue(full.Spec.MasterKubelet.ReconcileCIDR) != false { t.Fatalf("Unexpected ReconcileCIDR: %v", fi.BoolValue(full.Spec.MasterKubelet.ReconcileCIDR)) } }
explode_data.jsonl/75036
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 323 }
[ 2830, 3393, 11598, 6334, 28678, 31879, 33066, 44, 14199, 1155, 353, 8840, 836, 8, 341, 1444, 1669, 1936, 88328, 28678, 741, 1444, 36473, 4506, 33066, 44, 14199, 284, 9136, 52497, 3715, 340, 197, 12361, 11, 1848, 1669, 7854, 16055, 1337, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 841, 504, 7854, 16055, 25, 1018, 85, 497, 1848, 340, 197, 630, 9859, 284, 25001, 28933, 1368, 1337, 11, 9437, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 841, 504, 25001, 28933, 1368, 25, 1018, 85, 497, 1848, 340, 197, 630, 94042, 11, 1848, 1669, 46149, 11598, 6334, 28678, 8327, 1337, 340, 743, 1848, 961, 2092, 341, 197, 3244, 30762, 445, 29430, 1465, 504, 70938, 28678, 25, 1018, 85, 497, 1848, 340, 197, 532, 743, 9136, 52497, 1130, 28907, 36473, 71202, 42, 3760, 1149, 32287, 7939, 3173, 39949, 8, 961, 895, 341, 197, 3244, 30762, 445, 29430, 18567, 7939, 3173, 39949, 25, 1018, 85, 497, 9136, 52497, 1130, 28907, 36473, 71202, 42, 3760, 1149, 32287, 7939, 3173, 39949, 1171, 197, 532, 743, 9136, 52497, 1130, 28907, 36473, 71202, 42, 3760, 1149, 2817, 40446, 457, 54146, 49, 8, 961, 895, 341, 197, 3244, 30762, 445, 29430, 1032, 40446, 457, 54146, 49, 25, 1018, 85, 497, 9136, 52497, 1130, 28907, 36473, 71202, 42, 3760, 1149, 2817, 40446, 457, 54146, 49, 1171, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPutReflect(t *testing.T) { var a1 int16 = 42 var a2 float32 = 9.2 expected := make([]byte, 6) lex.PutInt16(expected, a1) lex.PutFloat32(expected[2:], a2) actual := make([]byte, 6) lex.PutReflect(actual, a1) lex.PutReflect(actual[2:], a2) assert.True(t, bytes.Equal(expected, actual)) }
explode_data.jsonl/50145
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 132 }
[ 2830, 3393, 19103, 72789, 1155, 353, 8840, 836, 8, 341, 2405, 264, 16, 526, 16, 21, 284, 220, 19, 17, 198, 2405, 264, 17, 2224, 18, 17, 284, 220, 24, 13, 17, 271, 42400, 1669, 1281, 10556, 3782, 11, 220, 21, 340, 197, 2571, 39825, 1072, 16, 21, 15253, 11, 264, 16, 340, 197, 2571, 39825, 5442, 18, 17, 15253, 58, 17, 45499, 264, 17, 692, 88814, 1669, 1281, 10556, 3782, 11, 220, 21, 340, 197, 2571, 39825, 72789, 29721, 11, 264, 16, 340, 197, 2571, 39825, 72789, 29721, 58, 17, 45499, 264, 17, 692, 6948, 32443, 1155, 11, 5820, 12808, 15253, 11, 5042, 1171, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestPipeWriteMultiThread(t *testing.T) { pReader, pWriter := New(WithSizeLimit(0)) var errg errgroup.Group for i := 0; i < 10; i++ { errg.Go(func() error { b := buf.New() b.WriteString("abcd") return pWriter.WriteMultiBuffer(buf.MultiBuffer{b}) }) } time.Sleep(time.Millisecond * 100) pWriter.Close() errg.Wait() b, err := pReader.ReadMultiBuffer() common.Must(err) if r := cmp.Diff(b[0].Bytes(), []byte{'a', 'b', 'c', 'd'}); r != "" { t.Error(r) } }
explode_data.jsonl/987
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 213 }
[ 2830, 3393, 34077, 7985, 20358, 6855, 1155, 353, 8840, 836, 8, 341, 3223, 5062, 11, 281, 6492, 1669, 1532, 7, 2354, 1695, 16527, 7, 15, 4390, 2405, 1848, 70, 1848, 4074, 5407, 198, 2023, 600, 1669, 220, 15, 26, 600, 366, 220, 16, 15, 26, 600, 1027, 341, 197, 9859, 70, 67131, 18552, 368, 1465, 341, 298, 2233, 1669, 6607, 7121, 741, 298, 2233, 44747, 445, 68644, 1138, 298, 853, 281, 6492, 4073, 20358, 4095, 10731, 57706, 4095, 90, 65, 3518, 197, 197, 3518, 197, 532, 21957, 31586, 9730, 71482, 353, 220, 16, 15, 15, 340, 3223, 6492, 10421, 741, 9859, 70, 28384, 2822, 2233, 11, 1848, 1669, 281, 5062, 6503, 20358, 4095, 741, 83825, 50463, 3964, 340, 743, 435, 1669, 26089, 98063, 1883, 58, 15, 936, 7078, 1507, 3056, 3782, 13608, 64, 516, 364, 65, 516, 364, 66, 516, 364, 67, 8275, 1215, 435, 961, 1591, 341, 197, 3244, 6141, 2601, 340, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetActionStr(t *testing.T) { tt := []struct { statement string actionStr string isError bool }{ { statement: "create table t (id int primary key)", actionStr: sqlparser.CreateStr, }, { statement: "alter table t drop column c", actionStr: sqlparser.AlterStr, }, { statement: "drop table t", actionStr: sqlparser.DropStr, }, { statement: "rename table t to t2", isError: true, }, } for _, ts := range tt { t.Run(ts.statement, func(t *testing.T) { onlineDDL := &OnlineDDL{SQL: ts.statement} _, actionStr, err := onlineDDL.GetActionStr() if ts.isError { assert.Error(t, err) } else { assert.NoError(t, err) assert.Equal(t, actionStr, ts.actionStr) } }) } }
explode_data.jsonl/42826
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 331 }
[ 2830, 3393, 1949, 2512, 2580, 1155, 353, 8840, 836, 8, 341, 3244, 83, 1669, 3056, 1235, 341, 197, 89566, 914, 198, 197, 38933, 2580, 914, 198, 197, 19907, 1454, 256, 1807, 198, 197, 59403, 197, 197, 515, 298, 89566, 25, 330, 3182, 1965, 259, 320, 307, 526, 6028, 1376, 15752, 298, 38933, 2580, 25, 5704, 9657, 7251, 2580, 345, 197, 197, 1583, 197, 197, 515, 298, 89566, 25, 330, 37277, 1965, 259, 5943, 3250, 272, 756, 298, 38933, 2580, 25, 5704, 9657, 76442, 2580, 345, 197, 197, 1583, 197, 197, 515, 298, 89566, 25, 330, 6719, 1965, 259, 756, 298, 38933, 2580, 25, 5704, 9657, 21688, 2580, 345, 197, 197, 1583, 197, 197, 515, 298, 89566, 25, 330, 51058, 1965, 259, 311, 259, 17, 756, 298, 19907, 1454, 25, 256, 830, 345, 197, 197, 1583, 197, 532, 2023, 8358, 10591, 1669, 2088, 17853, 341, 197, 3244, 16708, 35864, 1236, 5605, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 24630, 1056, 58781, 1669, 609, 19598, 58781, 90, 6688, 25, 10591, 1236, 5605, 532, 298, 197, 6878, 1917, 2580, 11, 1848, 1669, 2860, 58781, 2234, 2512, 2580, 741, 298, 743, 10591, 2079, 1454, 341, 571, 6948, 6141, 1155, 11, 1848, 340, 298, 197, 92, 770, 341, 571, 6948, 35699, 1155, 11, 1848, 340, 571, 6948, 12808, 1155, 11, 1917, 2580, 11, 10591, 12395, 2580, 340, 298, 197, 532, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAmount(t *testing.T) { tt := test.Start(t) defer tt.Finish() action := makeTestAction() result := action.GetAmount("minus_one") tt.Assert.NoError(action.Err) tt.Assert.Equal(xdr.Int64(-10000000), result) result = action.GetAmount("zero") tt.Assert.NoError(action.Err) tt.Assert.Equal(xdr.Int64(0), result) result = action.GetAmount("two") tt.Assert.NoError(action.Err) tt.Assert.Equal(xdr.Int64(20000000), result) result = action.GetAmount("twenty") tt.Assert.NoError(action.Err) tt.Assert.Equal(xdr.Int64(200000000), result) }
explode_data.jsonl/554
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 230 }
[ 2830, 3393, 10093, 1155, 353, 8840, 836, 8, 341, 3244, 83, 1669, 1273, 12101, 1155, 340, 16867, 17853, 991, 18176, 741, 38933, 1669, 1281, 2271, 2512, 2822, 9559, 1669, 1917, 2234, 10093, 445, 38365, 11667, 1138, 3244, 83, 11711, 35699, 15306, 27862, 340, 3244, 83, 11711, 12808, 2075, 3612, 7371, 21, 19, 4080, 16, 15, 15, 15, 15, 15, 15, 15, 701, 1102, 692, 9559, 284, 1917, 2234, 10093, 445, 14154, 1138, 3244, 83, 11711, 35699, 15306, 27862, 340, 3244, 83, 11711, 12808, 2075, 3612, 7371, 21, 19, 7, 15, 701, 1102, 692, 9559, 284, 1917, 2234, 10093, 445, 19789, 1138, 3244, 83, 11711, 35699, 15306, 27862, 340, 3244, 83, 11711, 12808, 2075, 3612, 7371, 21, 19, 7, 17, 15, 15, 15, 15, 15, 15, 15, 701, 1102, 692, 9559, 284, 1917, 2234, 10093, 445, 93965, 1138, 3244, 83, 11711, 35699, 15306, 27862, 340, 3244, 83, 11711, 12808, 2075, 3612, 7371, 21, 19, 7, 17, 15, 15, 15, 15, 15, 15, 15, 15, 701, 1102, 340, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestCommandNoEnvFileNoError(t *testing.T) { tmp := os.TempDir() cmd := cli.NewCommand("unit test") cmd.SetArgs([]string{"-c", path.Join(tmp, ".rr.yaml"), "--dotenv", path.Join(tmp, ".env")}) var executed bool f, err := os.Create(path.Join(tmp, ".env")) require.NoError(t, err) f2, err := os.Create(path.Join(tmp, ".rr.yaml")) require.NoError(t, err) defer func() { _ = f.Close() _ = f2.Close() }() if cmd.Run == nil { // override "Run" property for test (if it was not set) cmd.Run = func(cmd *cobra.Command, args []string) { executed = true } } assert.NoError(t, cmd.Execute()) assert.True(t, executed) t.Cleanup(func() { _ = os.RemoveAll(path.Join(tmp, ".env")) _ = os.RemoveAll(path.Join(tmp, ".rr.yaml")) }) }
explode_data.jsonl/17539
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 319 }
[ 2830, 3393, 4062, 2753, 14359, 1703, 2753, 1454, 1155, 353, 8840, 836, 8, 341, 20082, 1669, 2643, 65009, 6184, 2822, 25920, 1669, 21348, 7121, 4062, 445, 3843, 1273, 1138, 25920, 4202, 4117, 10556, 917, 4913, 12, 66, 497, 1815, 22363, 10368, 11, 5933, 634, 33406, 3975, 14482, 50893, 497, 1815, 22363, 10368, 11, 5933, 3160, 899, 8824, 2405, 15695, 1807, 271, 1166, 11, 1848, 1669, 2643, 7251, 5581, 22363, 10368, 11, 5933, 3160, 5455, 17957, 35699, 1155, 11, 1848, 340, 1166, 17, 11, 1848, 1669, 2643, 7251, 5581, 22363, 10368, 11, 5933, 634, 33406, 5455, 17957, 35699, 1155, 11, 1848, 692, 16867, 2915, 368, 341, 197, 197, 62, 284, 282, 10421, 741, 197, 197, 62, 284, 282, 17, 10421, 741, 197, 66816, 743, 5439, 16708, 621, 2092, 314, 442, 2812, 330, 6727, 1, 3343, 369, 1273, 320, 333, 432, 572, 537, 738, 340, 197, 25920, 16708, 284, 2915, 14160, 353, 59410, 12714, 11, 2827, 3056, 917, 8, 341, 298, 67328, 2774, 284, 830, 198, 197, 197, 532, 197, 630, 6948, 35699, 1155, 11, 5439, 13827, 2398, 6948, 32443, 1155, 11, 15695, 692, 3244, 727, 60639, 18552, 368, 341, 197, 197, 62, 284, 2643, 84427, 5581, 22363, 10368, 11, 5933, 3160, 5455, 197, 197, 62, 284, 2643, 84427, 5581, 22363, 10368, 11, 5933, 634, 33406, 5455, 197, 3518, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestAPIServiceResourceErrorActionable(t *testing.T) { tests := []struct { name string errs []error actionable bool }{ { name: "Nil/Actionable", errs: nil, actionable: true, }, { name: "Empty/Actionable", errs: nil, actionable: true, }, { name: "Error/Actionable", errs: []error{fmt.Errorf("err-a")}, actionable: true, }, { name: "Errors/Actionable", errs: []error{fmt.Errorf("err-a"), fmt.Errorf("err-b")}, actionable: true, }, { name: "ContainsUnadoptable/NotActionable", errs: []error{fmt.Errorf("err-a"), olmerrors.UnadoptableError{}}, actionable: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { op := &Operator{} aggregate := utilerrors.NewAggregate(tt.errs) require.Equal(t, tt.actionable, op.apiServiceResourceErrorActionable(aggregate)) }) } }
explode_data.jsonl/31216
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 476 }
[ 2830, 3393, 2537, 95125, 4783, 1454, 2512, 480, 1155, 353, 8840, 836, 8, 341, 78216, 1669, 3056, 1235, 341, 197, 11609, 981, 914, 198, 197, 9859, 82, 981, 3056, 841, 198, 197, 38933, 480, 1807, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 981, 330, 19064, 14, 2512, 480, 756, 298, 9859, 82, 25, 981, 2092, 345, 298, 38933, 480, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 981, 330, 3522, 14, 2512, 480, 756, 298, 9859, 82, 25, 981, 2092, 345, 298, 38933, 480, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 981, 330, 1454, 14, 2512, 480, 756, 298, 9859, 82, 25, 981, 3056, 841, 90, 12501, 13080, 445, 615, 7409, 79583, 298, 38933, 480, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 981, 330, 13877, 14, 2512, 480, 756, 298, 9859, 82, 25, 981, 3056, 841, 90, 12501, 13080, 445, 615, 7409, 3975, 8879, 13080, 445, 615, 1455, 79583, 298, 38933, 480, 25, 830, 345, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 981, 330, 23805, 1806, 98238, 480, 14, 2623, 2512, 480, 756, 298, 9859, 82, 25, 981, 3056, 841, 90, 12501, 13080, 445, 615, 7409, 3975, 8328, 76, 7650, 10616, 98238, 480, 1454, 6257, 1583, 298, 38933, 480, 25, 895, 345, 197, 197, 1583, 197, 630, 2023, 8358, 17853, 1669, 2088, 7032, 341, 197, 3244, 16708, 47152, 2644, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 39703, 1669, 609, 18461, 16094, 298, 197, 59606, 1669, 4094, 7650, 7121, 64580, 47152, 18441, 82, 340, 298, 17957, 12808, 1155, 11, 17853, 12395, 480, 11, 1179, 6183, 1860, 4783, 1454, 2512, 480, 7, 59606, 1171, 197, 197, 3518, 197, 630, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestMapProxy_GetAllWithNilKeys(t *testing.T) { _, err := mp.GetAll(nil) AssertErrorNotNil(t, err, "GetAll did not return an error for nil keys") mp.Clear() }
explode_data.jsonl/57023
{ "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, 2227, 16219, 13614, 2403, 2354, 19064, 8850, 1155, 353, 8840, 836, 8, 341, 197, 6878, 1848, 1669, 10490, 45732, 27907, 340, 18017, 1454, 96144, 1155, 11, 1848, 11, 330, 1949, 2403, 1521, 537, 470, 458, 1465, 369, 2092, 6894, 1138, 53230, 13524, 741, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestEffectiveProxyConfig(t *testing.T) { cases := []struct { name string configs []config.Config defaultConfig *meshconfig.ProxyConfig proxy *NodeMetadata expected *meshconfig.ProxyConfig }{ { name: "CR applies to matching namespace", configs: []config.Config{ newProxyConfig("ns", "test-ns", &v1beta1.ProxyConfig{ Concurrency: v(3), }), }, proxy: newMeta("test-ns", nil, nil), expected: &meshconfig.ProxyConfig{Concurrency: v(3)}, }, { name: "CR takes precedence over meshConfig.defaultConfig", configs: []config.Config{ newProxyConfig("ns", istioRootNamespace, &v1beta1.ProxyConfig{ Concurrency: v(3), }), }, defaultConfig: &meshconfig.ProxyConfig{Concurrency: v(2)}, proxy: newMeta("bar", nil, nil), expected: &meshconfig.ProxyConfig{Concurrency: v(3)}, }, { name: "workload matching CR takes precedence over namespace matching CR", configs: []config.Config{ newProxyConfig("workload", "test-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), Concurrency: v(3), }), newProxyConfig("ns", "test-ns", &v1beta1.ProxyConfig{ Concurrency: v(2), }), }, proxy: newMeta("test-ns", map[string]string{"test": "selector"}, nil), expected: &meshconfig.ProxyConfig{Concurrency: v(3)}, }, { name: "matching workload CR takes precedence over annotation", configs: []config.Config{ newProxyConfig("workload", "test-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), Concurrency: v(3), }), }, proxy: newMeta( "test-ns", map[string]string{ "test": "selector", }, map[string]string{ annotation.ProxyConfig.Name: "{ \"concurrency\": 5 }", }), expected: &meshconfig.ProxyConfig{Concurrency: v(3)}, }, { name: "CR in other namespaces get ignored", configs: []config.Config{ newProxyConfig("ns", "wrong-ns", &v1beta1.ProxyConfig{ Concurrency: v(1), }), newProxyConfig("workload", "wrong-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), Concurrency: v(2), }), newProxyConfig("global", istioRootNamespace, &v1beta1.ProxyConfig{ Concurrency: v(3), }), }, proxy: newMeta("test-ns", map[string]string{"test": "selector"}, nil), expected: &meshconfig.ProxyConfig{Concurrency: v(3)}, }, { name: "multiple matching workload CRs, oldest applies", configs: []config.Config{ setCreationTimestamp(newProxyConfig("workload-a", "test-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), EnvironmentVariables: map[string]string{ "A": "1", }, }), now), setCreationTimestamp(newProxyConfig("workload-b", "test-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), EnvironmentVariables: map[string]string{ "B": "2", }, }), now.Add(time.Hour)), setCreationTimestamp(newProxyConfig("workload-c", "test-ns", &v1beta1.ProxyConfig{ Selector: selector(map[string]string{ "test": "selector", }), EnvironmentVariables: map[string]string{ "C": "3", }, }), now.Add(time.Hour)), }, proxy: newMeta( "test-ns", map[string]string{ "test": "selector", }, map[string]string{}), expected: &meshconfig.ProxyConfig{ProxyMetadata: map[string]string{ "A": "1", }}, }, { name: "multiple matching namespace CRs, oldest applies", configs: []config.Config{ setCreationTimestamp(newProxyConfig("workload-a", "test-ns", &v1beta1.ProxyConfig{ EnvironmentVariables: map[string]string{ "A": "1", }, }), now), setCreationTimestamp(newProxyConfig("workload-b", "test-ns", &v1beta1.ProxyConfig{ EnvironmentVariables: map[string]string{ "B": "2", }, }), now.Add(time.Hour)), setCreationTimestamp(newProxyConfig("workload-c", "test-ns", &v1beta1.ProxyConfig{ EnvironmentVariables: map[string]string{ "C": "3", }, }), now.Add(time.Hour)), }, proxy: newMeta( "test-ns", map[string]string{}, map[string]string{}), expected: &meshconfig.ProxyConfig{ProxyMetadata: map[string]string{ "A": "1", }}, }, { name: "no configured CR or default config", proxy: newMeta("ns", nil, nil), }, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { store := newProxyConfigStore(t, tc.configs) m := &meshconfig.MeshConfig{ RootNamespace: istioRootNamespace, DefaultConfig: tc.defaultConfig, } pcs, err := GetProxyConfigs(store, m) if err != nil { t.Fatalf("failed to list proxyconfigs: %v", err) } merged := pcs.EffectiveProxyConfig( tc.proxy, &meshconfig.MeshConfig{ RootNamespace: istioRootNamespace, DefaultConfig: tc.defaultConfig, }) pc := mesh.DefaultProxyConfig() proto.Merge(&pc, tc.expected) if diff := cmp.Diff(merged, &pc); diff != "" { t.Fatalf("merged did not equal expected: %s", diff) } }) } }
explode_data.jsonl/52375
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 2476 }
[ 2830, 3393, 67539, 16219, 2648, 1155, 353, 8840, 836, 8, 341, 1444, 2264, 1669, 3056, 1235, 341, 197, 11609, 688, 914, 198, 197, 25873, 82, 981, 3056, 1676, 10753, 198, 197, 11940, 2648, 353, 23506, 1676, 75200, 2648, 198, 197, 197, 22803, 260, 353, 1955, 14610, 198, 197, 42400, 414, 353, 23506, 1676, 75200, 2648, 198, 197, 59403, 197, 197, 515, 298, 11609, 25, 330, 8973, 16790, 311, 12579, 4473, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8638, 16219, 2648, 445, 4412, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 79611, 25, 348, 7, 18, 1326, 464, 197, 30793, 298, 197, 1583, 298, 197, 22803, 25, 262, 501, 12175, 445, 1944, 12, 4412, 497, 2092, 11, 2092, 1326, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 18, 39781, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 8973, 4990, 53056, 916, 11294, 2648, 8764, 2648, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8638, 16219, 2648, 445, 4412, 497, 5999, 815, 8439, 22699, 345, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 79611, 25, 348, 7, 18, 1326, 464, 197, 30793, 298, 197, 1583, 298, 11940, 2648, 25, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 17, 39781, 298, 197, 22803, 25, 260, 501, 12175, 445, 2257, 497, 2092, 11, 2092, 1326, 298, 42400, 25, 414, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 18, 39781, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 1778, 1078, 12579, 12617, 4990, 53056, 916, 4473, 12579, 12617, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8638, 16219, 2648, 445, 1778, 1078, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 79611, 25, 348, 7, 18, 1326, 464, 197, 30793, 571, 8638, 16219, 2648, 445, 4412, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 79611, 25, 348, 7, 17, 1326, 464, 197, 30793, 298, 197, 1583, 298, 197, 22803, 25, 262, 501, 12175, 445, 1944, 12, 4412, 497, 2415, 14032, 30953, 4913, 1944, 788, 330, 8925, 14345, 2092, 1326, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 18, 39781, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 89043, 53596, 12617, 4990, 53056, 916, 21223, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8638, 16219, 2648, 445, 1778, 1078, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 79611, 25, 348, 7, 18, 1326, 464, 197, 30793, 298, 197, 1583, 298, 197, 22803, 25, 501, 12175, 1006, 571, 197, 1, 1944, 12, 4412, 756, 571, 19567, 14032, 30953, 515, 464, 197, 1, 1944, 788, 330, 8925, 756, 571, 197, 2137, 2415, 14032, 30953, 515, 464, 197, 24674, 75200, 2648, 2967, 25, 13868, 7245, 443, 15973, 11693, 220, 20, 335, 756, 571, 197, 30793, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 18, 39781, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 8973, 304, 1008, 58091, 633, 12036, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8638, 16219, 2648, 445, 4412, 497, 330, 34870, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 79611, 25, 348, 7, 16, 1326, 464, 197, 30793, 571, 8638, 16219, 2648, 445, 1778, 1078, 497, 330, 34870, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 79611, 25, 348, 7, 17, 1326, 464, 197, 30793, 571, 8638, 16219, 2648, 445, 9752, 497, 5999, 815, 8439, 22699, 345, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 79611, 25, 348, 7, 18, 1326, 464, 197, 30793, 298, 197, 1583, 298, 197, 22803, 25, 262, 501, 12175, 445, 1944, 12, 4412, 497, 2415, 14032, 30953, 4913, 1944, 788, 330, 8925, 14345, 2092, 1326, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 79611, 25, 348, 7, 18, 39781, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 35673, 12579, 53596, 12617, 82, 11, 23513, 16790, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 7409, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 29133, 788, 330, 16, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1326, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 1455, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 63590, 788, 330, 17, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1904, 9730, 73550, 6965, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 1786, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 5877, 25, 9367, 9147, 14032, 30953, 515, 1662, 197, 1, 1944, 788, 330, 8925, 756, 1144, 197, 30793, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 46316, 788, 330, 18, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1904, 9730, 73550, 6965, 298, 197, 1583, 298, 197, 22803, 25, 501, 12175, 1006, 571, 197, 1, 1944, 12, 4412, 756, 571, 19567, 14032, 30953, 515, 464, 197, 1, 1944, 788, 330, 8925, 756, 571, 197, 2137, 2415, 14032, 30953, 6257, 1326, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 16219, 14610, 25, 2415, 14032, 30953, 515, 571, 197, 29133, 788, 330, 16, 756, 298, 197, 22050, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 330, 35673, 12579, 4473, 12617, 82, 11, 23513, 16790, 756, 298, 25873, 82, 25, 3056, 1676, 10753, 515, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 7409, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 29133, 788, 330, 16, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1326, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 1455, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 63590, 788, 330, 17, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1904, 9730, 73550, 6965, 571, 8196, 32701, 20812, 1755, 16219, 2648, 445, 1778, 1078, 1786, 497, 330, 1944, 12, 4412, 756, 464, 197, 5, 85, 16, 19127, 16, 75200, 2648, 515, 1144, 197, 12723, 22678, 25, 2415, 14032, 30953, 515, 1662, 197, 46316, 788, 330, 18, 756, 1144, 197, 1583, 464, 197, 38842, 1431, 1904, 9730, 73550, 6965, 298, 197, 1583, 298, 197, 22803, 25, 501, 12175, 1006, 571, 197, 1, 1944, 12, 4412, 756, 571, 19567, 14032, 30953, 22655, 2415, 14032, 30953, 6257, 1326, 298, 42400, 25, 609, 23506, 1676, 75200, 2648, 90, 16219, 14610, 25, 2415, 14032, 30953, 515, 571, 197, 29133, 788, 330, 16, 756, 298, 197, 22050, 197, 197, 1583, 197, 197, 515, 298, 11609, 25, 220, 330, 2152, 19755, 12617, 476, 1638, 2193, 756, 298, 197, 22803, 25, 501, 12175, 445, 4412, 497, 2092, 11, 2092, 1326, 197, 197, 1583, 197, 630, 2023, 8358, 17130, 1669, 2088, 5048, 341, 197, 3244, 16708, 44415, 2644, 11, 2915, 1155, 353, 8840, 836, 8, 341, 298, 57279, 1669, 501, 16219, 2648, 6093, 1155, 11, 17130, 5423, 82, 340, 298, 2109, 1669, 609, 23506, 1676, 50155, 2648, 515, 571, 197, 8439, 22699, 25, 5999, 815, 8439, 22699, 345, 571, 91084, 2648, 25, 17130, 8764, 2648, 345, 298, 197, 532, 298, 3223, 4837, 11, 1848, 1669, 2126, 16219, 84905, 31200, 11, 296, 340, 298, 743, 1848, 961, 2092, 341, 571, 3244, 30762, 445, 16091, 311, 1140, 13291, 53978, 25, 1018, 85, 497, 1848, 340, 298, 197, 532, 298, 197, 40354, 1669, 70299, 5142, 39684, 16219, 2648, 1006, 571, 78255, 41103, 345, 571, 197, 5, 23506, 1676, 50155, 2648, 515, 464, 197, 8439, 22699, 25, 5999, 815, 8439, 22699, 345, 464, 91084, 2648, 25, 17130, 8764, 2648, 345, 571, 197, 3518, 298, 82013, 1669, 11294, 13275, 16219, 2648, 741, 298, 197, 15110, 93855, 2099, 3992, 11, 17130, 56835, 340, 298, 743, 3638, 1669, 26089, 98063, 7, 40354, 11, 609, 3992, 1215, 3638, 961, 1591, 341, 571, 3244, 30762, 445, 40354, 1521, 537, 6144, 3601, 25, 1018, 82, 497, 3638, 340, 298, 197, 532, 197, 197, 3518, 197, 532, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
3
func TestStructInfo(t *testing.T) { expect := StructInfo{ Type: reflect.TypeOf(testStruct{}), RawSchema: []byte("Field1\x00Field2\x00Foo\x00Bar\x00Astolfo"), Fields: []StructField{ { Type: reflect.TypeOf(""), Kind: reflect.String, Name: []byte("Field1"), Size: 2 * unsafe.Sizeof(0), Offset: 0, }, { Type: reflect.TypeOf(""), Kind: reflect.String, Name: []byte("Field2"), Size: 2 * unsafe.Sizeof(0), Offset: 2 * unsafe.Sizeof(0), }, { Type: reflect.TypeOf(int(0)), Kind: reflect.Int, Name: []byte("Foo"), Size: unsafe.Sizeof(0), Offset: 4 * unsafe.Sizeof(0), }, { Type: reflect.TypeOf(int(0)), Kind: reflect.Int, Name: []byte("Bar"), Size: unsafe.Sizeof(0), Offset: 5 * unsafe.Sizeof(0), }, { Type: reflect.TypeOf(anotherStruct{}), Kind: reflect.Struct, Name: []byte("Astolfo"), Size: 2 * unsafe.Sizeof(0), Offset: 6 * unsafe.Sizeof(0), }, }, } got := GetStructInfo(reflect.TypeOf(testStruct{})) for _, ineq := range deep.Equal(&expect, got) { t.Errorf("expect/got: %q", ineq) } }
explode_data.jsonl/9688
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 586 }
[ 2830, 3393, 9422, 1731, 1155, 353, 8840, 836, 8, 341, 24952, 1669, 16139, 1731, 515, 197, 27725, 25, 414, 8708, 73921, 8623, 9422, 6257, 1326, 197, 11143, 672, 8632, 25, 3056, 3782, 445, 1877, 16, 3462, 15, 15, 1877, 17, 3462, 15, 15, 40923, 3462, 15, 15, 3428, 3462, 15, 15, 61052, 337, 824, 4461, 197, 197, 8941, 25, 3056, 9422, 1877, 515, 298, 197, 515, 571, 27725, 25, 256, 8708, 73921, 445, 4461, 571, 197, 10629, 25, 256, 8708, 6431, 345, 571, 21297, 25, 256, 3056, 3782, 445, 1877, 16, 4461, 571, 91224, 25, 256, 220, 17, 353, 19860, 2465, 1055, 7, 15, 1326, 571, 197, 6446, 25, 220, 15, 345, 298, 197, 1583, 298, 197, 515, 571, 27725, 25, 256, 8708, 73921, 445, 4461, 571, 197, 10629, 25, 256, 8708, 6431, 345, 571, 21297, 25, 256, 3056, 3782, 445, 1877, 17, 4461, 571, 91224, 25, 256, 220, 17, 353, 19860, 2465, 1055, 7, 15, 1326, 571, 197, 6446, 25, 220, 17, 353, 19860, 2465, 1055, 7, 15, 1326, 298, 197, 1583, 298, 197, 515, 571, 27725, 25, 256, 8708, 73921, 1548, 7, 15, 6965, 571, 197, 10629, 25, 256, 8708, 7371, 345, 571, 21297, 25, 256, 3056, 3782, 445, 40923, 4461, 571, 91224, 25, 256, 19860, 2465, 1055, 7, 15, 1326, 571, 197, 6446, 25, 220, 19, 353, 19860, 2465, 1055, 7, 15, 1326, 298, 197, 1583, 298, 197, 515, 571, 27725, 25, 256, 8708, 73921, 1548, 7, 15, 6965, 571, 197, 10629, 25, 256, 8708, 7371, 345, 571, 21297, 25, 256, 3056, 3782, 445, 3428, 4461, 571, 91224, 25, 256, 19860, 2465, 1055, 7, 15, 1326, 571, 197, 6446, 25, 220, 20, 353, 19860, 2465, 1055, 7, 15, 1326, 298, 197, 1583, 298, 197, 515, 571, 27725, 25, 256, 8708, 73921, 38502, 1575, 9422, 6257, 1326, 571, 197, 10629, 25, 256, 8708, 51445, 345, 571, 21297, 25, 256, 3056, 3782, 445, 61052, 337, 824, 4461, 571, 91224, 25, 256, 220, 17, 353, 19860, 2465, 1055, 7, 15, 1326, 571, 197, 6446, 25, 220, 21, 353, 19860, 2465, 1055, 7, 15, 1326, 298, 197, 1583, 197, 197, 1583, 197, 630, 3174, 354, 1669, 2126, 9422, 1731, 13321, 767, 73921, 8623, 9422, 6257, 4390, 2023, 8358, 304, 11006, 1669, 2088, 5538, 12808, 2099, 17119, 11, 2684, 8, 341, 197, 3244, 13080, 445, 17119, 4846, 354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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 TestGetParametersFromSsmParameterStoreWithAllResolvedNoPaging(t *testing.T) { parametersList := []string{} expectedValues := map[string]SsmParameterInfo{} for i := 0; i < maxParametersRetrievedFromSsm/2; i++ { name := "name_" + strconv.Itoa(i) key := ssmNonSecurePrefix + name parametersList = append(parametersList, key) expectedValues[key] = SsmParameterInfo{ Name: name, Value: "value_" + name, Type: "String", } } serviceObject := newServiceMockedObjectWithExtraRecords(expectedValues) log := log.DefaultLogger() t.Log("Testing getParametersFromSsmParameterStore API for all parameters present without paging...") retrievedValues, err := getParametersFromSsmParameterStore(&serviceObject, log, parametersList) assert.Nil(t, err) assert.True(t, reflect.DeepEqual(expectedValues, retrievedValues)) }
explode_data.jsonl/56723
{ "file_path": "/home/dung/Study/Code/Cross_test_gen/training_dataset/dedup_data/clean_data_go/data/explode_data.jsonl", "token_count": 279 }
[ 2830, 3393, 1949, 9706, 3830, 50, 3563, 4971, 6093, 2354, 2403, 65394, 2753, 47, 4118, 1155, 353, 8840, 836, 8, 341, 67543, 852, 1669, 3056, 917, 16094, 42400, 6227, 1669, 2415, 14032, 60, 50, 3563, 4971, 1731, 31483, 2023, 600, 1669, 220, 15, 26, 600, 366, 1932, 9706, 12020, 82612, 3830, 50, 3563, 14, 17, 26, 600, 1027, 341, 197, 11609, 1669, 330, 606, 18771, 488, 33317, 64109, 1956, 340, 197, 23634, 1669, 274, 3563, 8121, 49813, 14335, 488, 829, 198, 197, 67543, 852, 284, 8737, 37959, 852, 11, 1376, 692, 197, 42400, 6227, 8157, 60, 284, 328, 3563, 4971, 1731, 515, 298, 21297, 25, 220, 829, 345, 298, 47399, 25, 330, 957, 18771, 488, 829, 345, 298, 27725, 25, 220, 330, 703, 756, 197, 197, 532, 197, 630, 52934, 1190, 1669, 501, 1860, 11571, 291, 1190, 2354, 11612, 25876, 15253, 6227, 692, 6725, 1669, 1487, 13275, 7395, 741, 3244, 5247, 445, 16451, 633, 9706, 3830, 50, 3563, 4971, 6093, 5333, 369, 678, 5029, 3042, 2041, 56287, 33093, 17200, 8927, 2066, 6227, 11, 1848, 1669, 633, 9706, 3830, 50, 3563, 4971, 6093, 2099, 7936, 1190, 11, 1487, 11, 5029, 852, 340, 6948, 59678, 1155, 11, 1848, 340, 6948, 32443, 1155, 11, 8708, 94750, 15253, 6227, 11, 30403, 6227, 1171, 92 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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