Code Monkey home page Code Monkey logo

tpg-tools2's Introduction

The Power of Go: Tools

This repository contains the code examples for the book The Power of Go: Tools, by John Arundel.

tpg-tools2's People

Contributors

bitfield avatar

Stargazers

Sal DiStefano avatar Somkiat Puisungnoen avatar Maxence Vinckevleugel avatar Gibran Iqbal avatar Alejandro R. Pascual avatar  avatar Gideon Idowu avatar  avatar Ahmad Abdul-Aziz  avatar Joseph Bassey avatar João Filipe Silva avatar David Chin avatar Youngjae Jay Lim avatar Samuel Chow avatar Anand Prabhu avatar Duncan L avatar Volker Schwaberow avatar Ram G. avatar Jakub Jarosz avatar Milos avatar Adam Chalkley avatar Lorenzo Di Marco avatar  avatar  avatar Christian Korneck avatar

Watchers

 avatar Jakub Jarosz avatar  avatar Adam Chalkley avatar

tpg-tools2's Issues

Bug: Testscript passes when it should fail

Here is the Main function for match:

func Main() int {
	m, err := NewMatcher(
		WithSearchTextFromArgs(os.Args[1:]),
	)
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		return 1
	}
	m.PrintMatchingLines()
	return 0
}

Let's remove the ability to process arguments

func Main() int {
	m, err := NewMatcher()
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		return 1
	}
	m.PrintMatchingLines()
	return 0
}

Executing the tests will still pass.


Let's also modify matches_lines_from_stdin.txtar to add one additional line that should match

stdin three_matching_lines.txt
exec match MAGIC
stdout -count=1 '^this line is MAGIC\n'
stdout -count=1 '^MAGIC is also on this line\n'
stdout -count=1 '^and MAGIC is here too\n'

-- three_matching_lines.txt --
this won't match
this line is MAGIC

MAGIC is also on this line
but not this one
and MAGIC is here too
MAGIC is a lie

Tests still pass, even though we haven't added a stdout directive to match the new line.

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.