Skip to content

Commit

Permalink
wasm/rna-transcription: 3rd iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Nov 28, 2023
1 parent 66f5ad2 commit 06d0acb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 43 deletions.
4 changes: 2 additions & 2 deletions wasm/rna-transcription/coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1701157789972" clover="3.2.0">
<project timestamp="1701157789972" name="All files">
<coverage generated="1701158897759" clover="3.2.0">
<project timestamp="1701158897759" name="All files">
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
</project>
</coverage>
2 changes: 1 addition & 1 deletion wasm/rna-transcription/coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-11-28T07:49:49.968Z
at 2023-11-28T08:08:17.756Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
13 changes: 2 additions & 11 deletions wasm/rna-transcription/rna-transcription.wat
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
;; (call $log_i32_u (local.get $number))
(memory (export "mem") 1)

(global $false i32 (i32.const 0))
(global $true i32 (i32.const 1))

;; 0=>false/disable, 1=>true/enable
(global $debug i32 (i32.const 1))

Expand Down Expand Up @@ -165,10 +162,7 @@
;; print i32u if debugging is enabled
(func $debug_print_i32u (export "debug_print_i32u") (param $value i32)
(if
(i32.eq
(global.get $debug)
(global.get $true)
) ;; eq
(global.get $debug)
(then
(call $log_i32_u (local.get $value))
) ;; then
Expand All @@ -178,10 +172,7 @@
;; print utf-8 str if debugging is enabled
(func $debug_print_str (export "debug_print_str") (param $offset i32) (param $length i32)
(if
(i32.eq
(global.get $debug)
(global.get $true)
) ;; eq
(global.get $debug)
(then
(call $log_mem_as_utf8 (local.get $offset) (local.get $length))
) ;; then
Expand Down
58 changes: 29 additions & 29 deletions wasm/rna-transcription/run-tests-wasm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,35 @@ Running: js-beautify ./babel.config.js ./rna-transcription.spec.js
beautified babel.config.js - unchanged
beautified rna-transcription.spec.js - unchanged

real 0m0.080s
user 0m0.075s
sys 0m0.017s
real 0m0.085s
user 0m0.076s
sys 0m0.022s


==============================================================================

Exit code: 0

real 0m0.360s
user 0m0.350s
sys 0m0.070s
real 0m0.395s
user 0m0.387s
sys 0m0.090s

real 0m0.362s
user 0m0.352s
sys 0m0.070s
real 0m0.399s
user 0m0.389s
sys 0m0.091s

===============================================================================

Running: npm install

up to date in 483ms
up to date in 500ms

107 packages are looking for funding
run `npm fund` for details

real 0m0.640s
user 0m0.804s
sys 0m0.087s
real 0m0.651s
user 0m0.866s
sys 0m0.090s

===============================================================================

Expand Down Expand Up @@ -82,7 +82,7 @@ Running: npm run test -- --coverage
> test
> node --experimental-vm-modules node_modules/jest/bin/jest.js ./* --coverage

(node:24061) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(node:5931) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
console.log
dna
Expand Down Expand Up @@ -261,12 +261,12 @@ Running: npm run test -- --coverage

PASS ./rna-transcription.spec.js
Transcription
✓ empty rna sequence (21 ms)
✓ empty rna sequence (20 ms)
✓ transcribes cytosine to guanine (5 ms)
✓ transcribes guanine to cytosine (4 ms)
✓ transcribes guanine to cytosine (5 ms)
✓ transcribes thymine to adenine (4 ms)
✓ transcribes adenine to uracil (5 ms)
✓ transcribes all dna nucleotides to their rna complements (4 ms)
✓ transcribes all dna nucleotides to their rna complements (5 ms)

----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
Expand All @@ -276,33 +276,33 @@ All files | 0 | 0 | 0 | 0 |
Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 0.354 s, estimated 1 s
Time: 0.34 s, estimated 1 s
Ran all test suites matching /.\/HELP.md|.\/LICENSE|.\/README.md|.\/babel.config.js|.\/node_modules|.\/package-lock.json|.\/package.json|.\/rna-transcription.spec.js|.\/rna-transcription.wat|.\/run-tests-wasm.txt/i.

real 0m0.951s
user 0m0.921s
sys 0m0.131s
real 0m0.961s
user 0m0.922s
sys 0m0.152s


==============================================================================

Exit code: 0

real 0m1.256s
user 0m1.226s
sys 0m0.182s
real 0m1.277s
user 0m1.231s
sys 0m0.223s

real 0m1.258s
user 0m1.227s
sys 0m0.184s
real 0m1.279s
user 0m1.232s
sys 0m0.224s

===============================================================================

Running: misspell ./rna-transcription.wat

real 0m0.033s
user 0m0.032s
sys 0m0.020s
user 0m0.036s
sys 0m0.014s

===============================================================================

Expand Down

0 comments on commit 06d0acb

Please sign in to comment.