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
| with Ada.Text_IO; use Ada.Text_IO; | |
| with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; | |
| with Ada.Numerics.Discrete_Random; | |
| procedure jdoodle is | |
| type Int_Array is array(Natural range <>) of Integer; | |
| function isSorted(numbers: Int_Array) return boolean is | |
| begin |
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
| // file: num-store.js | |
| // plain JS "store" - one of many possible! | |
| //----------- | |
| export const numberStore = { | |
| count: 0; | |
| } | |
| //----------- | |
| // file: incrementor.js |
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
| describe("more carrots means more carrot slices", () => { | |
| test.each` | |
| carrots | slices | |
| ${0} | ${0} | |
| ${1} | ${8} | |
| ${2} | ${16} | |
| ${3} | ${24} | |
| ${10} | ${80} | |
| ${20} | ${160} |
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
| /* | |
| Carrot Soup Factory | |
| =================== | |
| This creates carrot soup. (Go figure!) | |
| ## API | |
| Parameters: |
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
| function createCarrotSoup() { | |
| carrots = buyCarrots(); | |
| onions = buyOnions(); | |
| validateFreshness([carrots, onions]); | |
| pot = [carrots, onions, SALT]; | |
| hotPlate = startCooking(pot); |
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
| /* | |
| a recipe for carrot soup: | |
| 1. buy carrots & onions at the market (make sure they are fresh!) | |
| 2. slice carrots | |
| 3. slice onions | |
| 4. put carrots, onions & some salt in a pot | |
| 5. fill pot with water | |
| 6. heat it up |
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
| function launch() { | |
| trajectory = calculateTrajectory(); | |
| // use trajectory... | |
| } | |
| function calculateTrajectory() { | |
| x = 6; |
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
| function launch() { | |
| // calculate trajectory | |
| x = 6; | |
| y = 7; | |
| traj = x * y; | |
| // use traj... | |
| } |
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
| const a = { foo: undefined, bar: 1 }; | |
| const b = { bar: 2 }; | |
| test('toEqual wrongly reports undefined properties', () => { | |
| expect(a).toEqual(b); | |
| }); | |
| test('toStrictEqual wrongly reports undefined properties', () => { |
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.apache.http.client.fluent.Request; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| import org.mockserver.client.netty.NettyHttpClient; | |
| import org.mockserver.client.server.MockServerClient; | |
| import org.mockserver.model.HttpRequest; | |
| import org.mockserver.model.OutboundHttpRequest; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |