This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Expr { | |
Val(i32), | |
Div(Box<Expr>, Box<Expr>), | |
} | |
fn eval(expr: Expr) -> Option<i32> { | |
match expr { | |
Expr::Val(x) => Some(x), | |
Expr::Div(x, y) => { | |
let x = eval(*x)?; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/../test_helper' | |
class RangeTest < Test::Unit::TestCase | |
test <<-TEST do | |
Range#coinsides_with? | |
| | |
| | |
TEST | |
range = Time.zone.now..Time.zone.now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'action_mailer' | |
require 'mail' | |
module ActionMailer | |
class TestCase | |
def set_expected_mail | |
@expected = Mail.new | |
@expected.content_type = "text/plain; charset=#{charset}" | |
@expected.mime_version = '1.0' |