Skip to content

Commit

Permalink
Merge pull request #14 from codecrafters-io/CC-1192
Browse files Browse the repository at this point in the history
chores[deps]: tester-utils 0.2.20 upgrade
  • Loading branch information
ryan-gang authored Apr 29, 2024
2 parents f07f53c + e8159da commit f1671dc
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 203 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/codecrafters-io/bittorrent-tester
go 1.20

require (
github.com/codecrafters-io/tester-utils v0.2.18
github.com/codecrafters-io/tester-utils v0.2.20
github.com/jackpal/bencode-go v1.0.0
)

Expand All @@ -18,7 +18,7 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.19.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/codecrafters-io/tester-utils v0.2.17 h1:rO04TuOME773cZE729kIVOiXpZSq5
github.com/codecrafters-io/tester-utils v0.2.17/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.18 h1:fjIWERlzR1700Mogr8+30H3bYyLY+36KMU8ojloo3/0=
github.com/codecrafters-io/tester-utils v0.2.18/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.20 h1:t/IFFXOrSgRIoq6x4kUnRdjuai7EcwWH42Za25hvneA=
github.com/codecrafters-io/tester-utils v0.2.20/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
Expand Down Expand Up @@ -39,6 +41,8 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
206 changes: 103 additions & 103 deletions internal/test_helpers/fixtures/handshake/with_peer_check
Original file line number Diff line number Diff line change
@@ -1,75 +1,49 @@
Debug = true

[stage-1] Running tests for Stage #1: bencode-string
[stage-1] Running ./your_bittorrent.sh decode 4:pear
[your_program] "pear"
[stage-1] Running ./your_bittorrent.sh decode 55:http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] "http://bittorrent-test-tracker.codecrafters.io/announce"
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: bencode-int
[stage-2] Running ./your_bittorrent.sh decode i177586623e
[your_program] 177586623
[stage-2] Running ./your_bittorrent.sh decode i4294967300e
[your_program] 4294967300
[stage-2] Running ./your_bittorrent.sh decode i-52e
[your_program] -52
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: bencode-list
[stage-3] Running ./your_bittorrent.sh decode le
[stage-3] Expected output: []
[your_program] []
[stage-3] Running ./your_bittorrent.sh decode l4:peari461ee
[stage-3] Expected output: ["pear",461]
[your_program] ["pear",461]
[stage-3] Running ./your_bittorrent.sh decode lli461e4:pearee
[stage-3] Expected output: [[461,"pear"]]
[your_program] [[461,"pear"]]
[stage-3] Running ./your_bittorrent.sh decode lli4eei5ee
[stage-3] Expected output: [[4],5]
[your_program] [[4],5]
[stage-3] Test passed.
[stage-9] Running tests for Stage #9: handshake
[stage-9] Running ./your_bittorrent.sh handshake /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents3277457488/test.torrent 127.0.0.1:63432
[stage-9] Server started on port 127.0.0.1:63433...
[stage-9] 
[stage-9] Waiting for handshake message
[stage-9] Received handshake: [infohash: c7e51462e85d8631c25f8c9b8c5479345a1de26b, peer_id: 3030313132323333343435353636373738383939]
[stage-9] 
[stage-9] Sending back handshake with peer_id: ee8f5140bfc195c36b0567cd055ac9839e682ab0
[your_program] Peer ID: ee8f5140bfc195c36b0567cd055ac9839e682ab0
[stage-9] Test passed.

[stage-4] Running tests for Stage #4: bencode-dict
[stage-4] Running ./your_bittorrent.sh decode de
[stage-4] Expected output: {}
[your_program] {}
[stage-4] Running ./your_bittorrent.sh decode d3:foo4:pear5:helloi52ee
[stage-4] Expected output: {"foo":"pear","hello":52}
[your_program] {"foo":"pear","hello":52}
[stage-4] Running ./your_bittorrent.sh decode d10:inner_dictd4:key16:value14:key2i42e8:list_keyl5:item15:item2i3eeee
[stage-4] Expected output: {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
[your_program] {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
[stage-4] Test passed.
[stage-8] Running tests for Stage #8: peers
[stage-8] Running ./your_bittorrent.sh peers /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents1486925982/test.torrent
[stage-8] Server started on port 127.0.0.1:63438...
[stage-8] 
[your_program] 188.119.61.177:6881
[your_program] 71.224.0.29:51414
[your_program] 62.153.208.98:3652
[your_program] 37.48.74.20:44697
[your_program] 82.149.227.229:6890
[your_program] 195.90.215.221:45682
[your_program] 66.55.206.70:60000
[your_program] 69.53.20.159:60000
[your_program] 216.195.129.27:60000
[stage-8] Test passed.

[stage-5] Running tests for Stage #5: parse-torrent
[stage-5] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents26616866/codercat.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2994120
[your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db
[stage-7] Running tests for Stage #7: hashes
[stage-7] Running ./your_bittorrent.sh info /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents2337476787/test.torrent
[your_program] Tracker URL: http://bttracker.debian.org:6969/announce
[your_program] Length: 1835008
[your_program] Info Hash: 1840a71323682db707d1e8c9761049e875c03656
[your_program] Piece Length: 262144
[your_program] Piece hashes:
[your_program] 3c34309faebf01e49c0f63c90b7edcc2259b6ad0
[your_program] b8519b2ea9bb373ff567f644428156c98a1d00fc
[your_program] 9dc81366587536f48c2098a1d79692f2590fd9a6
[your_program] 033c61e717f8c0d1e55850680eb451e3543b6203
[your_program] 6f54e746ec369f65f32d45f77b1f1c37621fb965
[your_program] c656704b78107ed553bd0813f92fef780267c07b
[your_program] 7431b8683137d20ff594b1f1bf3f8835165d68fb
[your_program] 0432bd8e779608d27782b779c7738062e9b50ab5
[your_program] d6bc0409a0f3a9503857669d47fe752d4577ea00
[your_program] a86ee6abbc30cddb800a0b62d7a296111166d839
[your_program] 783f52b70f0c902d56196bd3ee7f379b5db57e3b
[your_program] 3d8db9e34db63b4ba1be27930911aa37b3f997dd
[stage-5] Checking for tracker URL (Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce)
[stage-5] Tracker URL is correct
[stage-5] Checking for length (Length: 2994120)
[stage-5] Length is correct
[stage-5] Test passed.
[your_program] c36b0567cd055ac9839e682ab0c3683bb691fa14
[your_program] 2e5f4c34811581d8f111711da2543c5156ba8db3
[your_program] f625823b4d61723ddfa8730c58c7841c7c3fc6b7
[your_program] 073e23c07900cb988096dc3cebff5aeb0c7f3d60
[your_program] 4522c52d3ade63bd0246d071b73ba94a1f5b9331
[your_program] 2a298e5564e38b2c3558b002aa3c862410c2bb47
[your_program] 70edcac2611a8829ebf467a6849f5d8408d9d8f4
[stage-7] Test passed.

[stage-6] Running tests for Stage #6: infohash
[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents652533747/itsworking.gif.torrent
[stage-6] Running ./your_bittorrent.sh info /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents2493686961/itsworking.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2549700
[your_program] Info Hash: 70edcac2611a8829ebf467a6849f5d8408d9d8f4
Expand All @@ -85,7 +59,7 @@ Debug = true
[your_program] 272a8ff8fc865b053d974a78681414b38077d7b1
[your_program] b07128d3a6018062bfe779db96d3a93c05fb81d4
[your_program] 7affc94f0985b985eb888a36ec92652821a21be4
[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents652533747/congratulations.gif.torrent
[stage-6] Running ./your_bittorrent.sh info /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents2493686961/congratulations.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 820892
[your_program] Info Hash: 1cad4a486798d952614c394eb15e75bec587fd08
Expand All @@ -95,7 +69,7 @@ Debug = true
[your_program] 69f885b3988a52ffb03591985402b6d5285940ab
[your_program] 76869e6c9c1f101f94f39de153e468be6a638f4f
[your_program] bded68d02de011a2b687f75b5833f46cce8e3e9c
[stage-6] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents652533747/codercat.gif.torrent
[stage-6] Running ./your_bittorrent.sh info /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents2493686961/codercat.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2994120
[your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db
Expand All @@ -115,44 +89,70 @@ Debug = true
[your_program] 3d8db9e34db63b4ba1be27930911aa37b3f997dd
[stage-6] Test passed.

[stage-7] Running tests for Stage #7: hashes
[stage-7] Running ./your_bittorrent.sh info /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents3537375949/test.torrent
[your_program] Tracker URL: http://bttracker.debian.org:6969/announce
[your_program] Length: 1835008
[your_program] Info Hash: 1840a71323682db707d1e8c9761049e875c03656
[stage-5] Running tests for Stage #5: parse-torrent
[stage-5] Running ./your_bittorrent.sh info /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/torrents1060379822/codercat.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2994120
[your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db
[your_program] Piece Length: 262144
[your_program] Piece hashes:
[your_program] c36b0567cd055ac9839e682ab0c3683bb691fa14
[your_program] 2e5f4c34811581d8f111711da2543c5156ba8db3
[your_program] f625823b4d61723ddfa8730c58c7841c7c3fc6b7
[your_program] 073e23c07900cb988096dc3cebff5aeb0c7f3d60
[your_program] 4522c52d3ade63bd0246d071b73ba94a1f5b9331
[your_program] 2a298e5564e38b2c3558b002aa3c862410c2bb47
[your_program] 70edcac2611a8829ebf467a6849f5d8408d9d8f4
[stage-7] Test passed.
[your_program] 3c34309faebf01e49c0f63c90b7edcc2259b6ad0
[your_program] b8519b2ea9bb373ff567f644428156c98a1d00fc
[your_program] 9dc81366587536f48c2098a1d79692f2590fd9a6
[your_program] 033c61e717f8c0d1e55850680eb451e3543b6203
[your_program] 6f54e746ec369f65f32d45f77b1f1c37621fb965
[your_program] c656704b78107ed553bd0813f92fef780267c07b
[your_program] 7431b8683137d20ff594b1f1bf3f8835165d68fb
[your_program] 0432bd8e779608d27782b779c7738062e9b50ab5
[your_program] d6bc0409a0f3a9503857669d47fe752d4577ea00
[your_program] a86ee6abbc30cddb800a0b62d7a296111166d839
[your_program] 783f52b70f0c902d56196bd3ee7f379b5db57e3b
[your_program] 3d8db9e34db63b4ba1be27930911aa37b3f997dd
[stage-5] Checking for tracker URL (Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce)
[stage-5] Tracker URL is correct
[stage-5] Checking for length (Length: 2994120)
[stage-5] Length is correct
[stage-5] Test passed.

[stage-8] Running tests for Stage #8: peers
[stage-8] Running ./your_bittorrent.sh peers /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1875521096/test.torrent
[stage-8] Server started on port 127.0.0.1:64027...
[stage-8] 
[your_program] 188.119.61.177:6881
[your_program] 71.224.0.29:51414
[your_program] 62.153.208.98:3652
[your_program] 37.48.74.20:44697
[your_program] 82.149.227.229:6890
[your_program] 195.90.215.221:45682
[your_program] 66.55.206.70:60000
[your_program] 69.53.20.159:60000
[your_program] 216.195.129.27:60000
[stage-8] Test passed.
[stage-4] Running tests for Stage #4: bencode-dict
[stage-4] Running ./your_bittorrent.sh decode de
[stage-4] Expected output: {}
[your_program] {}
[stage-4] Running ./your_bittorrent.sh decode d3:foo4:pear5:helloi52ee
[stage-4] Expected output: {"foo":"pear","hello":52}
[your_program] {"foo":"pear","hello":52}
[stage-4] Running ./your_bittorrent.sh decode d10:inner_dictd4:key16:value14:key2i42e8:list_keyl5:item15:item2i3eeee
[stage-4] Expected output: {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
[your_program] {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
[stage-4] Test passed.

[stage-9] Running tests for Stage #9: handshake
[stage-9] Running ./your_bittorrent.sh handshake /var/folders/08/v_mzt9816270xbqv5t3xgzyr0000gn/T/torrents1566550101/test.torrent 127.0.0.1:64029
[stage-9] Server started on port 127.0.0.1:64030...
[stage-9] 
[stage-9] Waiting for handshake message
[stage-9] Received handshake: [infohash: c7e51462e85d8631c25f8c9b8c5479345a1de26b, peer_id: 3030313132323333343435353636373738383939]
[stage-9] 
[stage-9] Sending back handshake with peer_id: ee8f5140bfc195c36b0567cd055ac9839e682ab0
[your_program] Peer ID: ee8f5140bfc195c36b0567cd055ac9839e682ab0
[stage-9] Test passed.
[stage-3] Running tests for Stage #3: bencode-list
[stage-3] Running ./your_bittorrent.sh decode le
[stage-3] Expected output: []
[your_program] []
[stage-3] Running ./your_bittorrent.sh decode l4:peari461ee
[stage-3] Expected output: ["pear",461]
[your_program] ["pear",461]
[stage-3] Running ./your_bittorrent.sh decode lli461e4:pearee
[stage-3] Expected output: [[461,"pear"]]
[your_program] [[461,"pear"]]
[stage-3] Running ./your_bittorrent.sh decode lli4eei5ee
[stage-3] Expected output: [[4],5]
[your_program] [[4],5]
[stage-3] Test passed.

[stage-2] Running tests for Stage #2: bencode-int
[stage-2] Running ./your_bittorrent.sh decode i177586623e
[your_program] 177586623
[stage-2] Running ./your_bittorrent.sh decode i4294967300e
[your_program] 4294967300
[stage-2] Running ./your_bittorrent.sh decode i-52e
[your_program] -52
[stage-2] Test passed.

[stage-1] Running tests for Stage #1: bencode-string
[stage-1] Running ./your_bittorrent.sh decode 4:pear
[your_program] "pear"
[stage-1] Running ./your_bittorrent.sh decode 55:http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] "http://bittorrent-test-tracker.codecrafters.io/announce"
[stage-1] Test passed.
Loading

0 comments on commit f1671dc

Please sign in to comment.