Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SandrineP committed Jan 13, 2025
1 parent 022e0e2 commit 4ae186c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions libmamba/src/api/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace mamba
regex = '^' + regex + '$';
}


std::regex spec_pat(regex);
auto all_records = prefix_data.all_pkg_mgr_records();

Expand All @@ -99,7 +98,7 @@ namespace mamba
std::sort(
keys.begin(),
keys.end(),
[](const std::string& a, const std::string& b) { return a > b; }
[](const std::string& a, const std::string& b) { return a >= b; }
);
}
else
Expand Down Expand Up @@ -186,9 +185,9 @@ namespace mamba
}
}

auto comparable = options.reverse ? compare_reverse_alphabetically
auto comparator = options.reverse ? compare_reverse_alphabetically
: compare_alphabetically;
std::sort(packages.begin(), packages.end(), comparable);
std::sort(packages.begin(), packages.end(), comparator);

// format and print table
printers::Table t({ "Name", "Version", "Build", "Channel" });
Expand Down
5 changes: 3 additions & 2 deletions micromamba/tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ def test_list_no_json(
packages = res[res.rindex("Channel") :].split("\n", 1)[1]
packages_list = packages.strip().split("\n")
header_delimiter = "\u2500"
if all([i == header_delimiter for i in packages_list[0]]):
if all([i in [header_delimiter, "\r"] for i in packages_list[0]]):
packages_list.pop(0)
for package in packages_list:
assert package[-11:] == "conda-forge"
channel = package.split(" ")[-1]
assert channel == "conda-forge"

if reverse_flag == "--reverse":
assert res.find("xtensor") > res.find("xtl")
Expand Down

0 comments on commit 4ae186c

Please sign in to comment.