This file contains hidden or 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
| Passed: | |
| [-100.09790645039675,-37.9884571699719,-4.602538675660013,58.097095299567435,-89.68624401811665,-133.14944463072513,87.3400144046296,176.58325624504357,49.868597032221665,-21.749069298168525,-158.7144092087317,-334.23784853894085,280.0546227178355,-151.5871011155534,-162.7613566937549,-96.30821772211806,-107.56561189155586,361.0449642740509,248.75710213998096,-35.72334788829347,31.8523249374552,-18.61289537345964,74.02805092131733,-133.9811592193192,646.201673165406,-62.4896041273738,-27.792646865365832,33.81343153923,370.21467937617257,170.66667164344508,42.09350513941299,168.6450120474631,138.2853088022002,-105.08866276560376,51.86352099608488,107.36747243351991,-204.71020916428049,5229.4618333538565] | |
| Passed: | |
| [91.11642035720861,20.420206523478125,-205.9377575143366,205.8567977604436,-616.6532404304093,-138.20027292617564,10.371409014560356,-218.0217299435047,-106.1980435579821,119.60334585996414,-79.84415265690619,-82.60555878562367,-43.38494454271792,-30.7015016197 |
This file contains hidden or 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
| array = [1.0,2.0,3.0] | |
| puts a.collect {|num| num * num} |
This file contains hidden or 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
| class Array | |
| def square | |
| self.collect {|num| num * num} | |
| end | |
| end | |
| puts [1.0,2.0,3.0].square |
This file contains hidden or 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 "rubygems" | |
| require "test/unit" | |
| class Array | |
| def square | |
| self.collect {|num| num * num} | |
| end | |
| end | |
| class TestLibraryFileName < Test::Unit::TestCase |
This file contains hidden or 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 "rubygems" | |
| require "test/unit" | |
| class Array | |
| def square | |
| self.each do |i| | |
| raise ArgumentError unless i.class == Float | |
| end | |
| self.collect {|num| num * num} |
This file contains hidden or 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
| @Test | |
| public void test1(){ | |
| List<Double> in = new ArrayList<Double>(); | |
| in.add(1d); | |
| in.add(2d); | |
| in.add(3d); | |
| List<Double> out = new ArrayList<Double>(); | |
| out.add(1d); | |
| out.add(4d); |
This file contains hidden or 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
| public class StringCalculator { | |
| public static int sum(String numberStr) { | |
| String defaultDelimiter = ",|\n"; | |
| String[] numbers; | |
| if(newDelimiter(numberStr)){ | |
| String newDelimiter = getNewDelimiter(numberStr); |
This file contains hidden or 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
| @Test | |
| public void test1(){ | |
| int count = 0; | |
| for (List<Integer> word : someNonEmptyLists(positiveIntegers())) { | |
| int sum = 0; | |
| count++; | |
| String numberStr = ""; | |
| for (Integer integer : word) { | |
| sum += integer; |
This file contains hidden or 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
| // QuickCheck For Java Code Ideas | |
| // haskell -> prop_test1 xs = not(null xs) ==> map(1*) ( square xs ) == map (\x -> x * x) xs | |
| // Rascunho, provavelmente nada a ve :D | |
| Property propTest = new Property(); | |
| propsTest.with(expectedFunction(), resultFunction("Test.functionToTest"), equals); | |
| QuickCheck(propsTest(), forAllIntegers()); |
This file contains hidden or 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
| class Temp | |
| attr_accessor :name | |
| def initialize(name) | |
| @name = name | |
| end | |
| end | |
| a = Temp.new("Edipo") | |
| b = Temp.new("Joao") |