ScalaTestでテストするときのメモ
build.sbt
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.10" % "2.1.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.11.3" % "test"
)
<?php | |
namespace Acme\DemoBundle\Controller; | |
use Acme\DemoBundle\Form\Entity\Item; | |
use Acme\DemoBundle\Form\Entity\Tag; | |
use Acme\DemoBundle\Form\Type\ItemWithTagsType; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpFoundation\Request; |
ScalaTestでテストするときのメモ
build.sbt
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.10" % "2.1.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.11.3" % "test"
)
<?php | |
class ATest extends \PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @test | |
* @dataProvider provider | |
*/ | |
public function テスト($a, $b) | |
{ | |
$this->assertThat($a == $b, $this->equalTo(true)); |
#!/usr/bin/env python | |
# -*- coding: utf-8 -* | |
# from http://tell-k.hatenablog.com/entry/2012/02/04/131805 | |
from pydoc import ModuleScanner | |
from string import find | |
modules = [] | |
def callback(path, modname, desc, modules=modules): |
<html> | |
<head> | |
<link rel="stylesheet" href="joint.css" /> | |
<script src="joint.js"></script> | |
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> | |
</head> | |
<body> | |
<div id="myholder"></div> |
<?php | |
class Lessons | |
{ | |
public function main($input) | |
{ | |
$submissions = $this->processInput($input); | |
$results = $this->mainProcess($submissions); | |
$output = $this->printResult($results); |
/** | |
* Class AddMultiController | |
* | |
* @Route("/bill") | |
*/ | |
class EditMultiController extends UsecaseController | |
{ | |
const ROUTE_INPUT = 'xnni_bill_editmulti_input'; | |
const ROUTE_CONFIRMATION = 'xnni_bill_editmulti_confirmation'; | |
const ROUTE_LIST = 'xnni_construction_receipt_check_search'; |
if (date.before(SUMMER_START) || date.after(SUMMER_END)) | |
charge = quantity * _winterRate + _winterServiceCharge; | |
else charge = quantity * _summerRate; | |
if (notSummer(date)) | |
charge = winterCharge(quantity); | |
else charge = summerCharge(quantity); |
Haydnをコレクション演算部分に適用する例
利用するコード: https://github.com/phpmentors-jp/workflower/blob/master/src/Workflow/Workflow.php#L411
package main | |
import( | |
"io"; | |
"fmt"; | |
"bytes"; | |
"template"; | |
"os"; | |
"strings"; | |
"strconv"; | |
"http"; |