Guest User

Untitled

a guest
Jun 12th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { max } from "./index";
  2.  
  3. describe("max number integer", () => {
  4.   test("first max", () => {
  5.     expect(max(3, 2)).toBe(3);
  6.   });
  7.  
  8.   test("second max", () => {
  9.     expect(max(2, 3)).toBe(3);
  10.   });
  11.  
  12.   test("2 zero", () => {
  13.     expect(max(0, 0)).toBe(0);
  14.   });
  15.  
  16.   test("1 zero, first int", () => {
  17.     expect(max(2, 0)).toBe(2);
  18.   });
  19.  
  20.   test("1 zero, second int", () => {
  21.     expect(max(0, 2)).toBe(2);
  22.   });
  23.  
  24.   test("integer equal", () => {
  25.     expect(max(2, 2)).toBe(2);
  26.   });
  27. });
  28.  
  29. describe("max number float", () => {
  30.   test("2 float, first max", () => {
  31.     expect(max(2.22, 1.11)).toBe(2.22);
  32.   });
  33.  
  34.   test("2 float, second max", () => {
  35.     expect(max(1.11, 2.22)).toBe(2.22);
  36.   });
  37.  
  38.   test("1 zero, first float", () => {
  39.     expect(max(1.11, 0)).toBe(1.11);
  40.   });
  41.  
  42.   test("1 zero, second float", () => {
  43.     expect(max(0, 1.11)).toBe(1.11);
  44.   });
  45.  
  46.   test("float equal", () => {
  47.     expect(max(2.33, 2.33)).toBe(2.33);
  48.   });
  49. });
  50.  
  51. describe("max number integer negative", () => {
  52.   test("2 int, 1 negative(second)", () => {
  53.     expect(max(2, -2)).toBe(2);
  54.   });
  55.  
  56.   test("2 int, 1 negative(first)", () => {
  57.     expect(max(-2, 2)).toBe(2);
  58.   });
  59.  
  60.   test("2 negative int, first max", () => {
  61.     expect(max(-2, -3)).toBe(-2);
  62.   });
  63.  
  64.   test("2 negative int, second max", () => {
  65.     expect(max(-3, -2)).toBe(-2);
  66.   });
  67.  
  68.   test("1 zero, first negative", () => {
  69.     expect(max(-2, 0)).toBe(0);
  70.   });
  71.  
  72.   test("1 zero, second negative", () => {
  73.     expect(max(0, -2)).toBe(0);
  74.   });
  75. });
  76.  
  77. describe("max number float negative", () => {
  78.   test("2 float, 1 negative(second)", () => {
  79.     expect(max(2.22, -2.32)).toBe(2.22);
  80.   });
  81.  
  82.   test("2 float, 1 negative(first)", () => {
  83.     expect(max(-2.22, 2.32)).toBe(2.32);
  84.   });
  85.  
  86.   test("2 negative float, first max", () => {
  87.     expect(max(-2.22, -3.22)).toBe(-2.22);
  88.   });
  89.  
  90.   test("2 negative float, second max", () => {
  91.     expect(max(-3.22, -2.22)).toBe(-2.22);
  92.   });
  93.  
  94.   test("1 zero, first negative float", () => {
  95.     expect(max(-2.22, 0)).toBe(0);
  96.   });
  97.  
  98.   test("1 zero, second negative float", () => {
  99.     expect(max(0, -2.22)).toBe(0);
  100.   });
  101. });
Advertisement
Add Comment
Please, Sign In to add comment