Blame view

emulateur/epsilon-nofrendo/poincare/test/identity.cpp 938 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  #include <assert.h>
  #include <quiz.h>
  #include "simplify_utils.h"
  
  QUIZ_CASE(poincare_identity_simple_term) {
    assert(identical_to("1", "1"));
    assert(!identical_to("1", "2"));
  
    assert(identical_to("A", "A"));
    assert(!identical_to("A", "B"));
  
    assert(identical_to("1+2", "1+2"));
    assert(!identical_to("1+2", "1+3"));
  
    assert(identical_to("1-2", "1-2"));
    assert(!identical_to("1-2", "1-3"));
  
    assert(identical_to("1*2", "1*2"));
    assert(!identical_to("1*2", "1*3"));
  
    assert(identical_to("1/2", "1/2"));
    assert(!identical_to("1/2", "1/3"));
  
    assert(identical_to("1^2", "1^2"));
    assert(!identical_to("1^2", "1^3"));
  
    assert(identical_to("cos(1)", "cos(1)"));
    assert(!identical_to("cos(1)", "cos(2)"));
  }
  
  QUIZ_CASE(poincare_identity_commutativity) {
    assert(equivalent_to("1+2", "2+1"));
    //assert(identical_to("1*2", "2*1"));
    assert(!equivalent_to("1-2", "2-1"));
    assert(!equivalent_to("1/2", "2/1"));
  }