Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions test/read_only_api_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,21 @@ end
@test hasghobj("master", first(branches(ghjl; auth = auth)))

# test GitHub.compare
@test compare(ghjl, "master", "master~"; auth = auth).behind_by == 1
let comparison = compare(ghjl, "master~", "master"; auth = auth)
@test comparison.ahead_by == 1
@test length(comparison.commits) == 1
# check if the latest commit it a merge commit
latest_commit = GitHub.branch(ghjl, "master"; auth=auth).commit
is_latest_commit_merge = length(latest_commit.parents) > 1
if is_latest_commit_merge
@test compare(ghjl, "master", "master~"; auth = auth).behind_by >= 1
let comparison = compare(ghjl, "master~", "master"; auth = auth)
@test comparison.ahead_by >= 1
@test length(comparison.commits) >= 1
end
else
@test compare(ghjl, "master", "master~"; auth = auth).behind_by == 1
let comparison = compare(ghjl, "master~", "master"; auth = auth)
@test comparison.ahead_by == 1
@test length(comparison.commits) == 1
end
end

# test GitHub.file, GitHub.directory, GitHub.readme, GitHub.permalink
Expand Down
Loading