File tree Expand file tree Collapse file tree 3 files changed +78
-0
lines changed Expand file tree Collapse file tree 3 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 1+ import { decimalToBinary } from '../DecimalToBinary'
2+
3+ test ( 'The Binary representation of 35 is 100011' , ( ) => {
4+ const res = decimalToBinary ( 35 )
5+ expect ( res ) . toBe ( '100011' )
6+ } )
7+
8+ test ( 'The Binary representation of 1 is 1' , ( ) => {
9+ const res = decimalToBinary ( 1 )
10+ expect ( res ) . toBe ( '1' )
11+ } )
12+
13+ test ( 'The Binary representation of 1000 is 1111101000' , ( ) => {
14+ const res = decimalToBinary ( 1000 )
15+ expect ( res ) . toBe ( '1111101000' )
16+ } )
17+
18+ test ( 'The Binary representation of 2 is 10' , ( ) => {
19+ const res = decimalToBinary ( 2 )
20+ expect ( res ) . toBe ( '10' )
21+ } )
22+
23+ test ( 'The Binary representation of 17 is 10001' , ( ) => {
24+ const res = decimalToBinary ( 17 )
25+ expect ( res ) . toBe ( '10001' )
26+ } )
Original file line number Diff line number Diff line change 1+ import { decimalToOctal } from '../DecimalToOctal'
2+
3+ test ( 'The Octal representation of 8 is 10' , ( ) => {
4+ const res = decimalToOctal ( 8 )
5+ expect ( res ) . toBe ( 10 )
6+ } )
7+
8+ test ( 'The Octal representation of 1 is 1' , ( ) => {
9+ const res = decimalToOctal ( 1 )
10+ expect ( res ) . toBe ( 1 )
11+ } )
12+
13+ test ( 'The Octal representation of 0 is 0' , ( ) => {
14+ const res = decimalToOctal ( 0 )
15+ expect ( res ) . toBe ( 0 )
16+ } )
17+
18+ test ( 'The Octal representation of 100 is 144' , ( ) => {
19+ const res = decimalToOctal ( 100 )
20+ expect ( res ) . toBe ( 144 )
21+ } )
22+
23+ test ( 'The Octal representation of 111 is 157' , ( ) => {
24+ const res = decimalToOctal ( 111 )
25+ expect ( res ) . toBe ( 157 )
26+ } )
Original file line number Diff line number Diff line change 1+ import { octalToDecimal } from '../OctToDecimal'
2+
3+ test ( 'The Decimal representation of Octal number 56 is 46' , ( ) => {
4+ const res = octalToDecimal ( 56 )
5+ expect ( res ) . toBe ( 46 )
6+ } )
7+
8+ test ( 'The Decimal representation of Octal number 99 is 81' , ( ) => {
9+ const res = octalToDecimal ( 99 )
10+ expect ( res ) . toBe ( 81 )
11+ } )
12+
13+ test ( 'The Decimal representation of Octal number 17 is 15' , ( ) => {
14+ const res = octalToDecimal ( 17 )
15+ expect ( res ) . toBe ( 15 )
16+ } )
17+
18+ test ( 'The Decimal representation of Octal number 100 is 64' , ( ) => {
19+ const res = octalToDecimal ( 100 )
20+ expect ( res ) . toBe ( 64 )
21+ } )
22+
23+ test ( 'The Decimal representation of Octal number 0 is 0' , ( ) => {
24+ const res = octalToDecimal ( 0 )
25+ expect ( res ) . toBe ( 0 )
26+ } )
You can’t perform that action at this time.
0 commit comments