Git Product home page Git Product logo

Comments (5)

dvirtz avatar dvirtz commented on July 30, 2024 1

Looks good. This is the test I did:

#include <trompeloeil.hpp>
#include <string_view>
#include <iostream>

struct S
{
  MAKE_MOCK1(func, void(std::string_view));
};

int main() {
  S s;
  ALLOW_CALL(s, func(trompeloeil::re("3")));
  s.func("3");
  try {
    s.func("4");
  } catch (const std::exception& ex) {
    std::cerr << "error: " << ex.what() << '\n';
  }
}

output is:

error: 
No match for call of func with signature void(std::string_view) with.
  param  _1 == 4

Tried s.func(trompeloeil::re("3")) at C:\Users\dyitzchaki\github\conan-center-index\recipes\trompeloeil\all\test_package\test_package.cpp:12
  Expected  _1 matching regular expression /3/

from trompeloeil.

rollbear avatar rollbear commented on July 30, 2024 1

I'm traveling right now, but I'll try to find the time to squeeze in a release tag soon.

from trompeloeil.

rollbear avatar rollbear commented on July 30, 2024

Thank you for reporting. This is because the standard library regexes only supports those. I'll see what I can do. I believe it can be done without too much trouble.

from trompeloeil.

rollbear avatar rollbear commented on July 30, 2024

Can you try branch string_view_re and report back how it works?

from trompeloeil.

rollbear avatar rollbear commented on July 30, 2024

Tagged v45 which includes this fix, so closing now.

from trompeloeil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.