mplex: core test links all real sources, add mplex_core_run.sh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,35 +22,6 @@
|
||||
|
||||
using namespace detz::mplex;
|
||||
|
||||
// ---- stand-ins for classes other forks own (only what the layout needs) ----------------
|
||||
// MplexPane / MplexVtScreen construction is stubbed so this test links without the pty code.
|
||||
MplexVtScreen::MplexVtScreen(int r, int c) : rows(r), cols(c) {}
|
||||
MplexPane::MplexPane(int ident, int cols, int rows, int, const std::string&, const std::string&)
|
||||
: id(ident), w(std::max(1, cols)), h(std::max(1, rows)), screen(std::max(1, rows), std::max(1, cols)), created(0) {}
|
||||
MplexPane::~MplexPane() {}
|
||||
|
||||
// MplexCommands::resolve is another fork's; when its object is not linked this transcription
|
||||
// (tai.py:15430) stands in so MplexConfig can be exercised.
|
||||
__attribute__((weak)) std::string MplexCommands::resolve(const std::string& word) {
|
||||
if (mplex_find_spec(word)) return word;
|
||||
for (const auto& spec : mplex_command_specs())
|
||||
for (const auto& alias : spec.aliases)
|
||||
if (alias == word) return spec.name;
|
||||
for (const auto& name : mplex_unsupported())
|
||||
if (name == word) throw MplexError("command not supported by mplex: " + word);
|
||||
std::vector<std::string> matches;
|
||||
for (const auto& spec : mplex_command_specs())
|
||||
if (spec.name.compare(0, word.size(), word) == 0) matches.push_back(spec.name);
|
||||
if (matches.size() == 1) return matches[0];
|
||||
if (matches.size() > 1) {
|
||||
std::sort(matches.begin(), matches.end());
|
||||
std::string list;
|
||||
for (size_t i = 0; i < matches.size() && i < 5; ++i) list += (i ? ", " : "") + matches[i];
|
||||
throw MplexError("ambiguous command: " + word + " (" + list + ")");
|
||||
}
|
||||
throw MplexError("unknown command: " + word);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
long failures = 0, checks = 0, known_deviations = 0;
|
||||
|
||||
Reference in New Issue
Block a user