3 ms·
The OP has since elaborated: > I don't think anybody has claimed this yet. But I _have_ made a similar claim, that some things can't be written in C. I'll el
by steveklabnik 3y ago
The OP has since elaborated:
> I don't think anybody has claimed this yet. But I _have_ made a similar claim, that some things can't be written in C. I'll elaborate on the project that started this thread: the fusefs test suite. When I designed the fusefs test
suite, I based it around the priniciple of Mocking. Each test case has a client thread that does normal file system access, and a server thread that implements a fuse file server. But it isn't a full implementation of a fuse file server; it's just a shim around a mock object. For each test case, the file server's behavior is programmed with expectations. The mocking technique is so limited and awkward to use in C that almost nobody bothers. Just compare the documentation for CMockery (C) with Mockall (Rust). C++'s Googlemock is somewhere in between.
https://lists.freebsd.org/archives/freebsd-hackers/2024-January/002852.html https://lists.freebsd.org/archives/freebsd-hackers/2024-Janu...
- Ferret7446 3y agoMocking is a horrible principle. It is probably the worst of the various types of test doubles, in terms of the kind of test design they imply. Software engineering would be significantly better off, IMO, if mocking were so awkward that no one bothers to do it, ever, in any language.
- steveklabnik 3y agoI don't fully agree but what I will say is that I perceive mocking to be not that easy or good in Rust, so it is surprising to me to see it cited positively.