rust-code-analysis icon indicating copy to clipboard operation
rust-code-analysis copied to clipboard

Add more mozcpp tests

Open Luni-4 opened this issue 4 years ago • 6 comments

It would be helpful to add more tests for mozcpp grammar starting from these groups of files (v0.17):

The artifacts are coming from #540

Luni-4 avatar Mar 11 '21 12:03 Luni-4

Tests for mozcpp grammar starting from this file (v0.19 #552):

Luni-4 avatar Mar 16 '21 14:03 Luni-4

Tests for mozcpp grammar starting from this file (v0.19):

Some random observations:

  • Only in /tmp/tree-sitter-mozcpp-old: cache_gecko-dev_widget_cocoa_nsMacDockSupport.mm.json
  • cache_gecko-dev_toolkit_mozapps_update_updater_launchchild_osx.mm.html, for the latest minimal test:
path: .spaces[5].metrics.loc.blank
old: 9.0
new: 0.0

0 is better than 9, as the correct result is 1, but it is wrong.

path: .spaces[5].metrics.nexits.sum
old: 1.0
new: 2.0

path: .spaces[5].metrics.nexits.average
old: 0.5
new: 1.0

they should both be 2, since there is a single function with two return statements.

Note: I didn't look at the entire file, there might be other things to find.

marco-c avatar Mar 17 '21 23:03 marco-c

lloc seems wrong on cache_gecko-dev_nsprpub_pr_src_cplus_rcnetdb.h.html and on cache_gecko-dev_dom_quota_MemoryOutputStream.cpp.html and on cache_gecko-dev_ipc_chromium_src_base_chrome_application_mac.mm.html.

marco-c avatar Mar 19 '21 11:03 marco-c

Other interesting tests can be found in this file json-diffs-and-minimal-tests.tar.gz generated from #611.

marco-c avatar Apr 09 '21 12:04 marco-c

We can use insta tests now

Luni-4 avatar Jan 13 '23 12:01 Luni-4

We can formulate them as insta tests, but we still have to add them.

marco-c avatar Jan 13 '23 12:01 marco-c