1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: remove module main from tests, that do not need to be internal

This commit is contained in:
Delyan Angelov 2022-12-26 15:31:23 +02:00
parent 728b4cffc3
commit 94a36c5ca4
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
58 changed files with 0 additions and 116 deletions

View File

@ -1,5 +1,3 @@
module main
type ALchar = char type ALchar = char
fn test_alias_char_type_reference() { fn test_alias_char_type_reference() {

View File

@ -1,5 +1,3 @@
module main
fn test_anon_fn_with_nested_anon_fn_args() { fn test_anon_fn_with_nested_anon_fn_args() {
mut xa := fn (x fn (int) string, y int) string { mut xa := fn (x fn (int) string, y int) string {
return x(y) return x(y)

View File

@ -1,5 +1,3 @@
module main
fn func(arg struct { foo string }) { fn func(arg struct { foo string }) {
assert arg.foo == 'foo' assert arg.foo == 'foo'
} }

View File

@ -1,5 +1,3 @@
module main
fn test_cast_bool_to_int() { fn test_cast_bool_to_int() {
i := true i := true
x := int(i) x := int(i)

View File

@ -1,5 +1,3 @@
module main
type CEnum = int type CEnum = int
enum Enum { enum Enum {

View File

@ -1,5 +1,3 @@
module main
fn test_cast_to_anon_sumtype() { fn test_cast_to_anon_sumtype() {
x := string|none(none) x := string|none(none)
println(x) println(x)

View File

@ -1,5 +1,3 @@
module main
fn test_cast_to_alias() { fn test_cast_to_alias() {
r1 := u8(u8(1)) r1 := u8(u8(1))
println(r1) println(r1)

View File

@ -1,5 +1,3 @@
module main
import datatypes import datatypes
struct Item { struct Item {

View File

@ -1,5 +1,3 @@
module main
// exploring `decode` options with nested structs // exploring `decode` options with nested structs
struct Parent { struct Parent {

View File

@ -1,5 +1,3 @@
module main
struct S1 {} struct S1 {}
fn test_comptime_for_method_call_str() { fn test_comptime_for_method_call_str() {

View File

@ -1,5 +1,3 @@
module main
fn write[T](out T) string { fn write[T](out T) string {
$if T.typ is bool { $if T.typ is bool {
println('FOO') println('FOO')

View File

@ -1,5 +1,3 @@
module main
import term import term
fn abc() { fn abc() {

View File

@ -1,5 +1,3 @@
module main
import os import os
const iterations = (os.getenv_opt('ITERATIONS') or { '5' }).int() const iterations = (os.getenv_opt('ITERATIONS') or { '5' }).int()

View File

@ -1,5 +1,3 @@
module main
import rand import rand
import rand.wyrand import rand.wyrand
import rand.splitmix64 import rand.splitmix64

View File

@ -1,5 +1,3 @@
module main
fn test_fixed_array_of_threads() { fn test_fixed_array_of_threads() {
mut avar := [8]thread string{} mut avar := [8]thread string{}
avar[0] = spawn printme() avar[0] = spawn printme()

View File

@ -1,5 +1,3 @@
module main
import time import time
struct Game { struct Game {

View File

@ -1,5 +1,3 @@
module main
type VkPresentModeKHR = u32 type VkPresentModeKHR = u32
fn create_c_array[T](len u32) &T { fn create_c_array[T](len u32) &T {

View File

@ -1,5 +1,3 @@
module main
fn get_value[T]() ?T { fn get_value[T]() ?T {
return none return none
} }

View File

@ -1,5 +1,3 @@
module main
struct Empty {} struct Empty {}
struct Node[T] { struct Node[T] {

View File

@ -1,5 +1,3 @@
module main
struct None {} struct None {}
pub type Maybe[T] = None | T pub type Maybe[T] = None | T

View File

@ -1,5 +1,3 @@
module main
interface TypeFactory[T] { interface TypeFactory[T] {
get_type(type_name string) T get_type(type_name string) T
} }

View File

@ -1,5 +1,3 @@
module main
struct Container[T] { struct Container[T] {
value T value T
} }

View File

@ -1,5 +1,3 @@
module main
fn test_generics_method_with_sumtype_args() { fn test_generics_method_with_sumtype_args() {
mut me := CatDad{} mut me := CatDad{}
ret := me.adopt[CatType, Cat](CatType.black, BlackCat{}) ret := me.adopt[CatType, Cat](CatType.black, BlackCat{})

View File

@ -1,5 +1,3 @@
module main
struct None {} struct None {}
type OptError = None | string type OptError = None | string

View File

@ -1,5 +1,3 @@
module main
pub struct Person { pub struct Person {
pub mut: pub mut:
id int id int

View File

@ -1,5 +1,3 @@
module main
pub struct Maybe[T] { pub struct Maybe[T] {
present bool present bool
val T val T

View File

@ -1,5 +1,3 @@
module main
pub struct Randomizer[T] { pub struct Randomizer[T] {
} }

View File

@ -1,5 +1,3 @@
module main
pub struct Reptile {} pub struct Reptile {}
pub struct Insect {} pub struct Insect {}

View File

@ -1,5 +1,3 @@
module main
pub struct Vec[T] { pub struct Vec[T] {
mut: mut:
data &T data &T

View File

@ -1,5 +1,3 @@
module main
fn foo[T](val T) ?T { fn foo[T](val T) ?T {
return val return val
} }

View File

@ -1,5 +1,3 @@
module main
fn test_go_call_fn_using_map_value() { fn test_go_call_fn_using_map_value() {
sum := fn (x int, y int) int { sum := fn (x int, y int) int {
return x + y return x + y

View File

@ -1,5 +1,3 @@
module main
import rand import rand
interface Sample { interface Sample {

View File

@ -1,5 +1,3 @@
module main
type ConfigValue = bool | int | string type ConfigValue = bool | int | string
type ConfigMap = map[string]ConfigValue type ConfigMap = map[string]ConfigValue

View File

@ -1,5 +1,3 @@
module main
import geometry { Line, Point, PointCond, Shape, point_str } import geometry { Line, Point, PointCond, Shape, point_str }
fn point_is(p Point, cond PointCond) bool { fn point_is(p Point, cond PointCond) bool {

View File

@ -1,5 +1,3 @@
module main
fn test_interface_embedding_call() { fn test_interface_embedding_call() {
g1 := G1{} g1 := G1{}
do_the_greet(g1) do_the_greet(g1)

View File

@ -1,5 +1,3 @@
module main
pub interface IObject { pub interface IObject {
mut: mut:
do_stuff() do_stuff()

View File

@ -1,5 +1,3 @@
module main
interface Getter { interface Getter {
get() string get() string
} }

View File

@ -1,5 +1,3 @@
module main
interface Speaker { interface Speaker {
say() string say() string
} }

View File

@ -1,5 +1,3 @@
module main
fn test_mark_as_referenced() { fn test_mark_as_referenced() {
if true { if true {
a := Type{} a := Type{}

View File

@ -1,5 +1,3 @@
module main
type Sum = Struct | int type Sum = Struct | int
struct Struct { struct Struct {

View File

@ -1,5 +1,3 @@
module main
fn has_optional() ?int { fn has_optional() ?int {
return 51 return 51
} }

View File

@ -1,5 +1,3 @@
module main
type Abc = int | rune | string | u32 type Abc = int | rune | string | u32
fn cyz() (Abc, string) { fn cyz() (Abc, string) {

View File

@ -1,5 +1,3 @@
module main
import time import time
struct Alarms { struct Alarms {

View File

@ -1,5 +1,3 @@
module main
fn test_shared_array_last() { fn test_shared_array_last() {
shared a := []int{} shared a := []int{}
lock { lock {

View File

@ -1,5 +1,3 @@
module main
import time import time
struct Alarms { struct Alarms {

View File

@ -1,5 +1,3 @@
module main
struct ABC { struct ABC {
mut: mut:
s string s string

View File

@ -1,5 +1,3 @@
module main
struct Aa { struct Aa {
mut: mut:
b []int b []int

View File

@ -1,5 +1,3 @@
module main
[heap] [heap]
pub struct Grid { pub struct Grid {
pub mut: pub mut:

View File

@ -1,5 +1,3 @@
module main
struct Anything { struct Anything {
mut: mut:
name string name string

View File

@ -1,5 +1,3 @@
module main
struct Person { struct Person {
name string name string
age int age int

View File

@ -1,5 +1,3 @@
module main
struct Animal { struct Animal {
Duck Duck
id int id int

View File

@ -1,5 +1,3 @@
module main
struct Author { struct Author {
username string username string
name string name string

View File

@ -1,5 +1,3 @@
module main
interface Greeting { interface Greeting {
tt ?string tt ?string
} }

View File

@ -1,5 +1,3 @@
module main
fn string_none() string|none { fn string_none() string|none {
return none return none
} }

View File

@ -1,5 +1,3 @@
module main
struct PlotData { struct PlotData {
dates []string dates []string
numerical_result []int numerical_result []int

View File

@ -1,5 +1,3 @@
module main
pub struct SomeThing { pub struct SomeThing {
pub: pub:
m map[string]string m map[string]string

View File

@ -1,5 +1,3 @@
module main
fn test_typeof_fn() { fn test_typeof_fn() {
assert typeof[fn (s string, x u32) (int, f32)]().name == 'fn (string, u32) (int, f32)' assert typeof[fn (s string, x u32) (int, f32)]().name == 'fn (string, u32) (int, f32)'
} }

View File

@ -1,5 +1,3 @@
module main
fn test_autoprint_string_vargs() { fn test_autoprint_string_vargs() {
add_s('a') add_s('a')
assert true assert true