MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / switching_nullToFileToProcess

Method switching_nullToFileToProcess

tests/test_command_row.cpp:124–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 // ---------------------------------------------------------------
123
124 void switching_nullToFileToProcess() {
125 // Start with NullProvider
126 std::unique_ptr<Provider> prov = std::make_unique<NullProvider>();
127 QCOMPARE(buildSourceLabel(*prov), QStringLiteral("source\u25BE"));
128
129 // User loads a file
130 prov = std::make_unique<BufferProvider>(QByteArray(64, '\0'), "game.exe");
131 QCOMPARE(buildSourceLabel(*prov), QStringLiteral("'game.exe'\u25BE"));
132
133 // User switches to a "process" -- simulate with a named BufferProvider
134 // (ProcessProvider needs Windows, but the label logic is the same)
135 prov = std::make_unique<BufferProvider>(QByteArray(64, '\0'), "notepad.exe");
136 // BufferProvider kind is "File", but the switching mechanism works the same
137 QCOMPARE(prov->kind(), QStringLiteral("File"));
138 QCOMPARE(prov->name(), QStringLiteral("notepad.exe"));
139 }
140};
141
142QTEST_MAIN(TestCommandRow)

Callers

nothing calls this directly

Calls 3

buildSourceLabelFunction · 0.85
kindMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected