MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / TEST_F

Function TEST_F

tests/test_uv_runner_proof.cpp:29–71  ·  view source on GitHub ↗

PROOF 1: Output is correctly captured and displayed

Source from the content-addressed store, hash-verified

27
28// PROOF 1: Output is correctly captured and displayed
29TEST_F(UvRunnerProofTest, OutputIsCorrectlyCaptured) {
30 UvRunner runner;
31
32 std::vector<std::string> captured_lines;
33 std::string full_output;
34
35 runner.set_output_callback([&](const std::string& line, bool is_error, bool is_line_update) {
36 captured_lines.push_back(line);
37 full_output += line + "\n";
38 // Print to console for visual verification
39 std::cout << "[UV OUTPUT] " << (is_line_update ? "(update) " : "") << line << std::endl;
40 });
41
42 bool completed = false;
43 bool success = false;
44 runner.set_completion_callback([&](bool s, int) {
45 completed = true;
46 success = s;
47 });
48
49 // Run "uv --version" which outputs something like "uv 0.5.14"
50 ASSERT_TRUE(runner.start({"--version"}));
51
52 while (runner.poll()) {
53 std::this_thread::sleep_for(milliseconds(10));
54 }
55
56 ASSERT_TRUE(completed);
57 ASSERT_TRUE(success);
58
59 // Verify output was captured
60 EXPECT_FALSE(captured_lines.empty()) << "No output lines captured";
61 EXPECT_FALSE(full_output.empty()) << "No output captured at all";
62
63 // Verify the output contains expected content (uv version string)
64 bool found_uv = full_output.find("uv") != std::string::npos;
65 EXPECT_TRUE(found_uv) << "Output should contain 'uv', got: " << full_output;
66
67 std::cout << "\n=== PROOF: Output correctly captured ===" << std::endl;
68 std::cout << "Total lines captured: " << captured_lines.size() << std::endl;
69 std::cout << "Full output:\n"
70 << full_output << std::endl;
71}
72
73// PROOF 2: UI is not blocked - poll() returns immediately
74TEST_F(UvRunnerProofTest, PollDoesNotBlock) {

Callers

nothing calls this directly

Calls 15

instanceFunction · 0.85
set_output_callbackMethod · 0.80
stringMethod · 0.80
venv_pythonMethod · 0.80
maxFunction · 0.50
minFunction · 0.50
push_backMethod · 0.45
startMethod · 0.45
pollMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected