Suche senden
Hochladen
Test::Base
•
Als PPT, PDF herunterladen
•
1 gefällt mir
•
1,507 views
Tatsuhiko Miyagawa
Folgen
Shibuya.pm tech talk #6
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 43
Jetzt herunterladen
Empfohlen
Short Introduction To "perl -d"
Short Introduction To "perl -d"
Workhorse Computing
Memory Manglement in Raku
Memory Manglement in Raku
Workhorse Computing
BSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
Workhorse Computing
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
Workhorse Computing
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
Metadata-driven Testing
Metadata-driven Testing
Workhorse Computing
Smoking docker
Smoking docker
Workhorse Computing
Pytest: escreva menos, teste mais
Pytest: escreva menos, teste mais
Erick Wilder
Empfohlen
Short Introduction To "perl -d"
Short Introduction To "perl -d"
Workhorse Computing
Memory Manglement in Raku
Memory Manglement in Raku
Workhorse Computing
BSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
Workhorse Computing
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
Workhorse Computing
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
Metadata-driven Testing
Metadata-driven Testing
Workhorse Computing
Smoking docker
Smoking docker
Workhorse Computing
Pytest: escreva menos, teste mais
Pytest: escreva menos, teste mais
Erick Wilder
Get your teeth into Plack
Get your teeth into Plack
Workhorse Computing
Findbin libs
Findbin libs
Workhorse Computing
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
Workhorse Computing
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing
Getting Testy With Perl6
Getting Testy With Perl6
Workhorse Computing
Unit Testing Lots of Perl
Unit Testing Lots of Perl
Workhorse Computing
Javascript Primer
Javascript Primer
Adam Hepton
Getting testy with Perl
Getting testy with Perl
Workhorse Computing
What's new in PHP 8.0?
What's new in PHP 8.0?
Nikita Popov
Effective Benchmarks
Effective Benchmarks
Workhorse Computing
PHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look Ahead
thinkphp
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
Ayesh Karunaratne
Webrtc mojo
Webrtc mojo
bpmedley
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
Nikita Popov
Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
Aaron Patterson
Perl web frameworks
Perl web frameworks
diego_k
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
James Titcumb
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
Fwdays
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
Sebastian Marek
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Frank Kleine
Exploiting Php With Php
Exploiting Php With Php
Jeremy Coates
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Park
pointstechgeeks
Weitere ähnliche Inhalte
Was ist angesagt?
Get your teeth into Plack
Get your teeth into Plack
Workhorse Computing
Findbin libs
Findbin libs
Workhorse Computing
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
Workhorse Computing
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing
Getting Testy With Perl6
Getting Testy With Perl6
Workhorse Computing
Unit Testing Lots of Perl
Unit Testing Lots of Perl
Workhorse Computing
Javascript Primer
Javascript Primer
Adam Hepton
Getting testy with Perl
Getting testy with Perl
Workhorse Computing
What's new in PHP 8.0?
What's new in PHP 8.0?
Nikita Popov
Effective Benchmarks
Effective Benchmarks
Workhorse Computing
PHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look Ahead
thinkphp
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
Ayesh Karunaratne
Webrtc mojo
Webrtc mojo
bpmedley
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
Nikita Popov
Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
Aaron Patterson
Perl web frameworks
Perl web frameworks
diego_k
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
James Titcumb
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
Fwdays
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
Sebastian Marek
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Frank Kleine
Was ist angesagt?
(20)
Get your teeth into Plack
Get your teeth into Plack
Findbin libs
Findbin libs
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Getting Testy With Perl6
Getting Testy With Perl6
Unit Testing Lots of Perl
Unit Testing Lots of Perl
Javascript Primer
Javascript Primer
Getting testy with Perl
Getting testy with Perl
What's new in PHP 8.0?
What's new in PHP 8.0?
Effective Benchmarks
Effective Benchmarks
PHP 5.3 And PHP 6 A Look Ahead
PHP 5.3 And PHP 6 A Look Ahead
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
Webrtc mojo
Webrtc mojo
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
Perl web frameworks
Perl web frameworks
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Ähnlich wie Test::Base
Exploiting Php With Php
Exploiting Php With Php
Jeremy Coates
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Park
pointstechgeeks
Modern Perl
Modern Perl
Marcos Rebelo
RingoJS
RingoJS
Oleg Podsechin
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
Alexis Sukrieh
Zend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j query
Tricode (part of Dept)
Php Loop
Php Loop
lotlot
Introduction To Moco
Introduction To Moco
Naoya Ito
Advanced Perl Techniques
Advanced Perl Techniques
Dave Cross
JSON and the APInauts
JSON and the APInauts
Wynn Netherland
Testing Javascript with Jasmine
Testing Javascript with Jasmine
Tim Tyrrell
PHP Presentation
PHP Presentation
Ankush Jain
Bash Scripting Gabrovo
Bash Scripting Gabrovo
Marian Marinov
Advanced Perl Techniques
Advanced Perl Techniques
Dave Cross
Groovy every day
Groovy every day
Paul Woods
Rack Middleware
Rack Middleware
LittleBIGRuby
using python module: doctest
using python module: doctest
mitnk
Abuse Perl
Abuse Perl
Casey West
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
Micha Kops
Ggug spock
Ggug spock
Skills Matter
Ähnlich wie Test::Base
(20)
Exploiting Php With Php
Exploiting Php With Php
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Park
Modern Perl
Modern Perl
RingoJS
RingoJS
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
Zend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j query
Php Loop
Php Loop
Introduction To Moco
Introduction To Moco
Advanced Perl Techniques
Advanced Perl Techniques
JSON and the APInauts
JSON and the APInauts
Testing Javascript with Jasmine
Testing Javascript with Jasmine
PHP Presentation
PHP Presentation
Bash Scripting Gabrovo
Bash Scripting Gabrovo
Advanced Perl Techniques
Advanced Perl Techniques
Groovy every day
Groovy every day
Rack Middleware
Rack Middleware
using python module: doctest
using python module: doctest
Abuse Perl
Abuse Perl
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
Ggug spock
Ggug spock
Mehr von Tatsuhiko Miyagawa
Carton CPAN dependency manager
Carton CPAN dependency manager
Tatsuhiko Miyagawa
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
Tatsuhiko Miyagawa
Plack at OSCON 2010
Plack at OSCON 2010
Tatsuhiko Miyagawa
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010
Tatsuhiko Miyagawa
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
Tatsuhiko Miyagawa
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
Tatsumaki
Tatsumaki
Tatsuhiko Miyagawa
Intro to PSGI and Plack
Intro to PSGI and Plack
Tatsuhiko Miyagawa
CPAN Realtime feed
CPAN Realtime feed
Tatsuhiko Miyagawa
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
Tatsuhiko Miyagawa
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
Remedie OSDC.TW
Remedie OSDC.TW
Tatsuhiko Miyagawa
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
Tatsuhiko Miyagawa
20 modules i haven't yet talked about
20 modules i haven't yet talked about
Tatsuhiko Miyagawa
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LT
Tatsuhiko Miyagawa
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
Tatsuhiko Miyagawa
Web::Scraper
Web::Scraper
Tatsuhiko Miyagawa
Mehr von Tatsuhiko Miyagawa
(20)
Carton CPAN dependency manager
Carton CPAN dependency manager
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
Plack at OSCON 2010
Plack at OSCON 2010
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Plack - LPW 2009
Plack - LPW 2009
Tatsumaki
Tatsumaki
Intro to PSGI and Plack
Intro to PSGI and Plack
CPAN Realtime feed
CPAN Realtime feed
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie OSDC.TW
Remedie OSDC.TW
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
20 modules i haven't yet talked about
20 modules i haven't yet talked about
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LT
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
Web::Scraper
Web::Scraper
Kürzlich hochgeladen
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
The Digital Insurer
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Kürzlich hochgeladen
(20)
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Test::Base
1.
use Test::Base; Tatsuhiko
Miyagawa [email_address] Six Apart, Ltd. / Shibuya Perl Mongers Shibuya.pm Tech Talks #7
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
Filter arguments ===
filter args --- input lines array tail=2 Join foo Bar baz --- expected chomp regexp=xis bar.*baz
18.
filters __DATA__ ===
test 1 --- input foo bar baz xxx --- expected quox yyy === test 2 --- input foo bar baz xxx --- expected quox yyy === test 3 --- input foo bar baz xxx --- expected quox yyy
19.
filters filters {
input => [ 'foo', 'bar', 'baz' ], expected => 'quox' }; __DATA__ === test 1 --- input xxx --- expected yyy === test 2 --- input xxx --- expected yyy === test 3 --- input xxx --- expected yyy
20.
21.
Auto-diff 01-json....NOK 1
# Failed test ' # @@ -1,2 +1,2 @@ # -{"foo":"bar"} # +{ foo => "bar" } # xxx # ' Requires Algorithm::Diff Turn off with no_diff()
22.
23.
24.
25.
26.
run_compare is default!
# 01-json.t use Test::Base; use JSON::Syck; sub json { JSON::Syck::Dump($_[0]) } __END__ === --- input eval json { foo => "bar" } --- expected chomp {"foo":"bar"} === --- input eval json { foo => [ "bar", "baz" ] } --- expected regexp bar.*baz
27.
run # 01-json.t
use Test::Base; use JSON::Syck; plan tests => 1 * blocks; run { my $block = shift; is JSON::Syck::Dump($block->input), $block->expected, $block->name; }; __END__ === --- input eval { foo => "bar" } --- expected chomp {"foo":"bar"}
28.
blocks() # 01-json.t
use Test::Base; use JSON::Syck; plan tests => 1 * blocks; for my $block (blocks) { is JSON::Syck::Dump($block->input), $block->expected, $block->name; } __END__ === --- input eval { foo => "bar" } --- expected chomp {"foo":"bar"}
29.
Block specific use
Test::Base; run_compare; __END__ === --- ONLY --- input eval json { foo => "bar" } --- expected chomp {"foo":"bar"} === --- input eval json { foo => [ "bar", "baz" ] } --- expected regexp bar.*baz
30.
Block specific use
Test::Base; run_compare; __END__ === --- SKIP --- input eval json { foo => "bar" } --- expected chomp {"foo":"bar"} === --- input eval json { foo => [ "bar", "baz" ] } --- expected regexp bar.*baz
31.
Subclassing Test::Base #
t/TestJSON.pm package t::TestJSON; use Test::Base -Base; use JSON::Syck; package t::TestJSON::Filter; use Test::Base::Filter –base; sub json { JSON::Syck::Dump($_[0]) } # t/01-json.t use t::TestJSON; __END__ === --- input eval json { foo => "bar" } --- expected …
32.
In your CPAN
modules use inc::Module::Install; name 'Foo-Bar'; all_from 'lib/Foo/Bar.pm'; use_test_base; WriteAll;
33.
34.
Spiffy XXX XXX
$foo = $bar; WWW $bar; YYY $baz; ZZZ $quox;
35.
no chomp filters
use Test::Base; filters { input => 'chomp', expected => 'chomp' } __END__ === --- input foo --- expected bar === --- input fooaba --- expected bzaahiepa
36.
no chomp filters
use Test::Base; __END__ === --- input: foo --- expected: bar === --- input: fooaba --- expected: bzaahiepa
37.
success tests vs.
error tests # t/01-success.t run_is 'input' => 'expected'; # t/02-failure.t run { my $block = shift; eval { … }; run_like $@, $block->expected; } ;
38.
39.
40.
41.
42.
43.
Jetzt herunterladen