Skip to content

Commit

Permalink
more guess tests (#145)
Browse files Browse the repository at this point in the history
* add regression test for #109

* forgot to include python guess files

* add tests to test suite
  • Loading branch information
cdmistman authored Oct 24, 2023
1 parent 4ddb627 commit dadb4aa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test-suite/Guess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestGuess(t *testing.T) {
"basic",
"dedup",
"nested",
"esparse-fail",
}
}

Expand All @@ -50,6 +51,8 @@ func TestGuess(t *testing.T) {

tests[ext]["py"] = []string{
"basic",
"dedup",
"replit-packages",
}
}

Expand Down
7 changes: 7 additions & 0 deletions test-suite/templates/guess/js/esparse-fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import express from 'express';

const foo = ({
// esparse fails to parse the default argument here,
// resulting in the full guess failing
bar = () => { },
}) => { };
1 change: 1 addition & 0 deletions test-suite/templates/guess/js/esparse-fail.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
express
3 changes: 3 additions & 0 deletions test-suite/templates/guess/py/basic
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render
from flask import Flask
import replit.ai
3 changes: 3 additions & 0 deletions test-suite/templates/guess/py/basic.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
django
flask
replit-ai
4 changes: 4 additions & 0 deletions test-suite/templates/guess/py/dedup
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import django
from django.conf import settings
from django.shortcuts import render
from flask import Flask
2 changes: 2 additions & 0 deletions test-suite/templates/guess/py/dedup.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
django
flask
2 changes: 2 additions & 0 deletions test-suite/templates/guess/py/replit-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import replit
import replit.ai
2 changes: 2 additions & 0 deletions test-suite/templates/guess/py/replit-packages.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
replit
replit-ai

0 comments on commit dadb4aa

Please sign in to comment.