小编swa*_*kar的帖子

是否可以使用PHPUnit对除类文件以外的php文件进行单元测试?

我是PHPUnit的新手。我的php文件中没有任何类。通过阅读文档可以了解,PHPUnit将类视为一个单元。那么,PHPUnit是否将类视为一个单元? 是否可以测试其中没有任何类的php文件?

php phpunit unit-testing

4
推荐指数
1
解决办法
1183
查看次数

Ex 1-17无限循环

我正在通过K&R学习C,我试图为Ex 1-17编写程序,该程序应打印字符超过80的行.对于字符小于80的行,但对于行数大于80的行,写入的代码可以正常工作我的编译器挂起运行时.这就是我输入的方式 - 我输入随机的80多个字符,最后按回车键,我的编译器挂起,我必须强制终止它.我在Windows XP上使用Turbo c ++ v4.5. 我的问题是为什么我的编译器在按下回车后挂起? 请帮我解决这个问题.

#include<stdio.h>
/* Program to print lines having length more than 80 chars */

#define MAX 80
#define MAXSIZE 1000

int getline( char a[], int b );
void copy ( char to[], char from[] );

main()
{
  int len1, len2;
  char line [ MAXSIZE ];
  char longest [ MAXSIZE ];

  len1 = len2 = 0;

  while( ( len1 = getline( line , MAXSIZE ) ) > 0 …
Run Code Online (Sandbox Code Playgroud)

c

1
推荐指数
1
解决办法
85
查看次数

标签 统计

c ×1

php ×1

phpunit ×1

unit-testing ×1