TOUT texte que vous pouvez voir dans une fenêtre Emacs fait toujours partie d'un tampon.
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
| package com.mathieupauly.selectionsort; | |
| import org.junit.Test; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| public class SelectionSortTest { | |
| private SelectionSort selectionSort = new SelectionSort(); |
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
| ; CIDER 0.8.1 (package: 20141120.1746) (Java 1.8.0_111, Clojure 1.8.0, nREPL 0.2.12) | |
| clojure-brave-true-exercises.core> (str nil) | |
| "" | |
| clojure-brave-true-exercises.core> (str) | |
| "" | |
| clojure-brave-true-exercises.core> (str "hello") | |
| "hello" | |
| clojure-brave-true-exercises.core> (str "A" "B") | |
| "AB" | |
| clojure-brave-true-exercises.core> (str :x :y) |
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
| (ns clojure-brave-true-exercises.crashcourse-test | |
| (:require [clojure.test :refer :all])) | |
| (deftest map-empty | |
| (testing "empty" | |
| (is (= #{} (mapset inc []))))) | |
| (defn mapset [f list] #{}) | |
| (deftest map-singleton |
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
| import org.junit.Test; | |
| public class ArrayCovarianceTest { | |
| @Test(expected = ArrayStoreException.class) | |
| public void cat_should_not_be_set_in_dog_list() { | |
| Animal[] animals = new Dog[1]; // array covariance | |
| // Java compiler allows the assignment because Dog extends Animal | |
| // But the Java runtime throws a "java.lang.ArrayStoreException: Cat" |