Enumerations

enum EditType
Name Value
kMatch 0
kAdd 1
kRemove 2
kReplace 3

Returns the optimal edits to go from 'left' to 'right'.

All edits cost the same, with replace having lower priority than

add/remove.

Simple implementation of the Wagner-Fischer algorithm.

See https://en.wikipedia.org/wiki/Wagner-Fischer_algorithm

Defined at line 173 of file ../../third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h

Functions

  • std::vector<EditType> CalculateOptimalEdits (const std::vector<size_t> & left, const std::vector<size_t> & right)
  • std::vector<EditType> CalculateOptimalEdits (const std::vector<std::string> & left, const std::vector<std::string> & right)

    Same as above, but the input is represented as strings.

  • std::string CreateUnifiedDiff (const std::vector<std::string> & leftconst std::vector<std::string> & rightsize_t context)

    Create a diff of the input strings in Unified diff format.